CalcIt Commands

READDIR(DirPath, FullPath=true, FullInfo=false, DirLevel=1)

Returns the contents of a directory and its subdirectories as an array.

  • DirPath. Path to directory. Use wildcards to select the filenames.
  • FullPath. Optional. Default value (if omitted) is TRUE and controls whether filenames will have full paths or not. TRUE (1) means full paths.
  • FullInfo. Optional. If true then all file information are returned in the form of delimited text. 

    c:\calcit\calcit.exe|1195008|28/05/2002|18:29:02|0

    In the above example the default delimiter character is used (|). The meaning of the parts is the following:

    1. File name (and path if Fullpath is true)
    2. File size in bytes
    3. File date
    4. File Time (hh:mm:ss)
    5. Read Only flag (0 for Read-Write, 1 for Read only)
  • DirLevel. Optional. 1 if omitted. Defines the nest level in reading the subdirectories of the requested directory. Use 0 to read all subdirectories of a directory.

Clear;
set dr=READDIR('c:\*.*');
PrintArr(dr);

It is used in array expressions.

See also SET, Array Expressions.

Go Back