Legato
Legato

GoFiler Legato Script Reference

 

Legato v 1.5d

Application v 5.25a

  

 

Chapter SixFile Functions (continued)

EnumerateFolderDetails Function

Overview

The EnumerateFolderDetails function returns a table folder and file names with basic details about each entry using a specified path and wildcard mask. It can optionally recursively search folders.

Syntax/Parameters

Syntax

string [][] = EnumerateFolderDetails ( string path, [dword flags] );

Parameters

path

A string containing a qualified path and optional wild card match. The path can contain a *.* or other matching wildcard pattern. If a wildcard is missing, the default is *.*.

flags

An optional dword specifying flags. If the parameter is omitted, the default is FOLDER_LOAD_NO_FOLDER_NAV.

  Defines   Bitwise   Description  
  Append Flags:          
    FOLDER_LOAD_RECURSE   0x00000001   Recurse into subdirectories  
    FOLDER_LOAD_FOLDER_TO_BRACKETS   0x00000002   Add brackets to directory names  
    FOLDER_LOAD_FOLDER_NAMES   0x00000004   Add folder names  
    FOLDER_LOAD_RECENT_30   0x00000008   Load only past 30 days  
    FOLDER_LOAD_NO_FOLDER_NAV   0x00000010   Skip the '.' and '..' entries  
    FOLDER_LOAD_NO_HIDDEN   0x00000020   Do not load hidden files  
    FOLDER_LOAD_NO_SYSTEM   0x00000040   Do not load system files  
    FOLDER_LOAD_CASE_SENSITIVE   0x00000080   Match case-sensitive  
    FOLDER_LOAD_MATCH_FOLDERS   0x00000100   Apply Mask to Folder Names  
  Files:        
    FOLDER_UTF_NAMES   0x00001000   Contain UTF coded name (Unicode)  
  Operation:        
    FOLDER_USE_PROGRESS   0x00100000   Use Legato's Progress Display  

  

Return Value

Returns a string table of file and folder names, details and relative paths as appropriate or an empty array on failure. Use the GetLastError function to retrieve error information.

The return filename values will be UTF encoded for filenames with Unicode characters.

Remarks

Because an empty table could indicate both and error or the lack of any matching result, the GetLastError function should be used to determine if an error occurred. This function does not enumerate file names.

The table will contain the following column keys:

  Key Name   Description  
  Name   Filename and path, relative to the function path parameter.  
  AttributeBits   A hex string containing the 32-bit binary attribute bits. See GetFileAttributeString for additional information.  
  Attributes   A formatted string containing entry attributes. See GetFileAttributeString for additional information.  
  CreateTime   The creation time in ISO-8601 as UTC.  
  CreateFileTime   A hex string containing the 64-bit file create time value. See GetFileCreateTime for additional information.  
  AccessTime   The last access time in ISO-8601 as UTC.  
  AccessFileTime   A hex string containing the 64-bit file access time value.  
  ModifiedTime   The last write time in ISO-8601 as UTC.  
  ModifiedFileTime   A hex string containing the 64-bit file write time value. See GetFileModifiedTime for additional information.  
  Size   The file size in formatted binary unit types. See IntegerToBinaryUnits for additional information.  
  Bytes   A decimal string of the 64-bit byte value.  

 

Note that when recursion is enabled, the function can consume a fair amount of time loading the table and the resulting table can be rather large. For example, enumerating the windows directory and all its folders can take more than a minute.

Related Functions

Platform Support

Go13, Go16, GoFiler Complete, GoFiler Corporate, GoFiler, GoFiler Lite, GoXBRL

Legato IDE, Legato Basic