his book shows how to recursively scan a directory tree. Since the "DIR$" command cannot
be nested a simple recursive call to the scanning function is not possible. So it is a
good idea to store all found sub-directories in an array and process them seperately after
the current directory has been entirely scanned.
Scanning a directory tree
his program expects a starting directory (path) as command line argument. Then it will
show the number of files and directories in that directory and all sub-directories.
'Author : Daniel, Master Sourcerer at Kitana's Cas...
'Last change: July 27, 2004
'Email : email@example.com
'Recursively scans a directory tree
%MAXDIRS = 256
'Scan a directory and all of its sub-directories
IF (GETATTR(P$+F$) AND 16)=0 THEN 'a file
ELSE 'a directory
IF F$<>"." AND F$<>".."THEN 'ignore up-director...
IF NDIRS&<%MAXDIRS THEN