Announcement

Collapse
No announcement yet.

Using DIR$ below top directory?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Michael Mattias
    replied
    For PB-DOS 3.5, it's "findfile.bas" not "filefind.bas"

    Leave a comment:


  • Tom Hanlin
    replied
    See the FILEFIND.BAS example.

    ------------------
    Tom Hanlin
    PowerBASIC Staff

    Leave a comment:


  • Mel Bishop
    replied
    Originally posted by Robert Carneal:
    Is it possible to use DIR$ so that it automatically goes to
    each subdirectory...
    In a word, no. During the DIR$ sequence, you will have to
    identify the subdirectry (Attrib=16) then CHDIR to switch
    directories.

    Counting files in a subdirectory is easy
    Code:
    mask$ = "*.*"
    counter = 0
    attribute = 8
    
    te$ = dir$(mask$,attribute)
    do until te$ = ""
    incr counter
    te$ = dir$
    loop
    print;counter
    Check the documentation to find uses of the attribute option.


    ------------------


    [This message has been edited by Mel Bishop (edited July 29, 2003).]

    Leave a comment:


  • Robert E. Carneal
    started a topic Using DIR$ below top directory?

    Using DIR$ below top directory?

    I know how to use DIR$ so that it returns filenames. I would like
    to count the number of files (not directories) on a CD / DVD.
    Is it possible to use DIR$ so that it automatically goes to each
    subdirectory and I can count the files there?

    Thank you.

    Robert

    ------------------
Working...
X