Download Now

    Reference faReadOnly

    Declared in Codebot.System.pas on line 758

    File attributes used by FindOpen and FindFiles
    { Find files from ParamStr at start index returning a strings object. The caller
      is responsible for freeing FileParams. }
    procedure FindFileParams(StartIndex: Integer; out FileParams: TStrings);
    
    { File attributes used by FindOpen and FindFiles }
    const
      faReadOnly = $00000001;
    
    { FindOpen corrects path delimiters and convert search to an output parameter }
    function FindOpen(const Path: string; Attr: Longint; out Search: TSearchRec): LongInt;
    { Find file system items from a path outputting to a TStrings object. The caller
      is responsible for freeing FileSearch. }
    procedure FindFiles(const Path: string; out FileSearch: TStrings; Attributes: Integer = 0); overload;
    
    { TFileSearchItem holds the details of one file or directory found by
      FindFiles }
    type
      TFileSearchItem = record
      public
        { The full path to the file or folder }
        Name: string;
        { The size in bytes of the item }
        Size: LargeInt;
        { The last modified date and time }
        Modified: TDateTime;
        { Details about the type of item found }
        Attributes: Integer;
      end;
    
    { TFileSearch is a list of items found by FindFiles }
      TFileSearch = type TArrayList<TFileSearchItem>;
    
    { Find file system items from a path outputting to a TFileSearch array }
    procedure FindFiles(const Path: string; out FileSearch: TFileSearch; Attributes: Integer = 0); overload;
    
    { TFileSearchHelper adds sorting methods to TFileSearch }
    type
      TFileSearchHelper = record helper for TFileSearch
      public
        { Sort search items by file name }
        procedure SortName(Order: TSortingOrder = soAscend);
        { Sort search items by file size }
        procedure SortSize(Order: TSortingOrder = soAscend);
        { Sort search items by file modified date }
        procedure SortModified(Order: TSortingOrder = soAscend);
      end;

    See also