JCL Help:BuildFileList

From Project JEDI Wiki
Jump to navigationJump to search


Summary

Builds a list of files and folders in a directory.


Pascal

 function BuildFileList(const Path: string; const Attr: Integer; const List: TStrings; IncludeDirectoryName: Boolean = False): Boolean;


Parameters

Parameters Description
const Path: string Directory and filename 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 List: TStrings A TStrings descendant in which the file list that matched the Path and Attr 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

BuildFileList builds a list of files and folders in the specified Path that matches the specified attributes. This is simply a convenient wrapper for the FindFirst, FindNext and FindClose functions.


See Also

AdvBuildFileList


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