litLIB Help
Product pages :
Quick links:
help index

File System - Dir

=Dir(PathName, Optional FileIndex, Optional Attributes)

Returns the name of the file specified by the path name (directory name). Use the FileIndex parameter to specify which file you would like to return (the first, second, third, etc).
Equivalent to the Visual Basic Dir function.

PathName : Name of the directory containing the file
FileIndex : Optional. Index of the file to return.
Attributes : Optional. A constant to specify the type of file to find. 0 (default) are normal files, 1 denote read-only files, 2 specified hidden files, 4 specifies system files, 8 specifies volume names, 16 specifies directory names, 64 denotes Macintosh Aliases.

You can combine the attributes by adding the particular attribute constants together. E.g. the attribute value of 1+2=3 denotes read-only system files.

Find the first file in C:\
Find the second file in C:\
Find the third file in C:\