DIR() |
|
|
The DIR() function returns the contents of an operating system directory.
Format
DIR(pathname)
where
The DIR() function returns a dynamic array with one field per entry in the specified directory. Each field contains the following items separated by value marks:
A = archive C = compressed H = hidden R = read only S = system T = temporary On other platforms, this value contains the file permissions as a decimal value.
The standard . and .. directory entries are not returned.
Applications should not assume that this structure will remain unchanged. Additional values may appear in future releases.
Because the DIR() function returns data for the entire directory as a single string, it could fail for very large directories.
Example
FILES = DIR('C:\MYDIR') NUM.FILES = DCOUNT(FILES, @FM) FOR I = 1 TO NUM.FILES IF FILES<I,2> = 'F' THEN DISPLAY FILES<I,1> NEXT I
The above example lists all the files in C:\MYDIR, omitting subdirectories. |