Skip to content

TFloFileSearch Class ​

The NewFileSearch function returns a TFloFileSearch object.

The TFloFileSearch object class supports the properties as listed in the table below, in the format -

TFloFileSearch.<property>

Property NameDescription
CountThe number of matching files.
Accessing this property causes the search criteria to be re-applied and a new file search to be performed to identify the matching files AND to be performed again to reset the search to enable files to be processed individually if required.
EOFIndicates that no more files are found.
Use in conjunction with the Next method (as described below) to process matching files one at a time, using the FileAttr, FileName and FileSize properties.
ExistsIndicates whether any files match the criteria.
FileAttrATTR mask for the current file.
FileNameFilename of the current file.
FileSizeThe size (in bytes) of the current file.

TFloFileSearch also supports the following methods as below, using the format -

TFloFileSearch.<method>

Method NameDescription
GetFileNames(TStringList)Retrieves a list of all matching filenames that meet the search criteria into the TStringList supplied.
This list must be created before calling the method.
NextCall this method to advance the search to the Next matching file.
Use in conjunction with the EOF, FileAttr, FileName and FileSize properties.
FreeEmpties/clears the TFloFileSearch object.
Calling this method causes the search criteria to be re-applied and a new file search to be performed to identify the matching files AND to be performed again to reset the search to enable files to be processed individually if required.

The TFloFileSearch object result that is returned must be disposed of when finished with, using the Free method, as per the following example.

pascal
vsearch := NewFileSearch(PATH, SPEC, ATTR);
try
//The code to be processed
finally
  vsearch.Free;
end;

For additional information, please refer to the NewFileSearch function.