JCL Help:AdvBuildFileList

From Project JEDI Wiki
Jump to navigationJump to search


Summary

AdvBuildFileList works like BuildFileList if called with only three parameters, but it accepts two optional parameters for extended functionality.


Pascal

 function AdvBuildFileList(const Path: string; const Attr: Integer; const Files: TStrings; const AttributeMatch: TJclAttributeMatch = amSuperSetOf; const Options: TFileListOptions = []; const SubfoldersMask: string = ; const FileMatchFunc: TFileMatchFunc = nil): Boolean;


Parameters

Parameters Description
const Path: string Directory and file name mask for which you want to build the list. For example this can be 'c:winnt*.dll'. This parameter works like the Path parameter in FindFirst. In Windows it is case insensitive and applies to short and long filenames, so "*.*" will find all files. In Linux it's case sensitive and "*.*" will find only files that contain a ".".
const Attr: Integer The Attr parameter specifies the special files to include in addition to all normal files. Choose from these file attribute constants when specifying the Attr parameter (declared in SysUtils.pas): * faReadOnly Read-only files * faHidden Hidden files * faSysFile System files * faVolumeID Volume ID files * faDirectory Directory files * faArchive Archive files * faAnyFile Any file
const Options: TFileListOptions = [] Set of additional option: * flFullNames: if set, the full path is included with each listed file name. * flRecursive: if set, all subdirectories of the directory given in PATH are scanned. * flMaskedSubfolders: if set, files are only listed if their directory path, relative to the directory given in the Path parameter, matches the Subfolder Mask parameter.
const SubfoldersMask: string = if flMaskedSubfolders is set, the remaining directory path, relative to the directory given in the Path parameter, is matched against this parameter. In Windows the matching is done case insensitively, in Linux it's done case sensitively. In Windows (with long file names enabled) only the long name is matched, so "*.*" will find only directories that contain a ".".
List A TStrings descendant in which the file list according to the parameters is returned. Note that this list is not cleared by the routine before the found entries are added.


Return Value

If the function succeeds it returns True, otherwise it returns False. In case of failure the list contains the entries that were retrieved up to the point of failure.


Description

AdvBuildFileList builds a list of files and folders in the specified Path that matches the specified attributes.


See Also

BuildFileList


About

Unit

JclFileUtils


Donator

Marcel van Brakel


Contribute to this help topic

This documentation wiki is based on the collaborative effort of Project JEDI users. Your edits are welcome in order to improve documentation quality: edit this page