|
|
|
|
|
- Handling errors
- Listing the subdirectories of a directory
fListFile (Function) In french: fListeFichier Lists the files found in a directory and returns the list of files. The listed files are sought from the given directory. Other use: For each file found, the fListFile function can automatically call a specific procedure written in WLanguage.. This procedure is used to handle the current file. In this case, fListFile returns the number of listed files. Note: Under 64-bit Windows, access to a system directory from a 32-bit executable may be performed in a directory other than the expected one.. For more details, see Native 64-bit and native 32-bit.
Syntax
Listing the files found in a directory Hide the details
<Result> = fListFile(<Path and generic name of files> , <Options>)
<Result>: Character string Full name of listed files, separated by CR characters (Carriage Return).
Attention: The function returns files whose short or long name matches the filter. <Path and generic name of files>: Character string Path and generic name of files to list. Generic characters (* and?) are allowed. Special cases:- if directory and drive not specified: the search path is built up from the current drive and the current directory for that drive.
- if the drive is not specified but the directory is: the search path is formed from the current drive and the directory passed as a parameter.
- if the drive is specified while the directory is not specified, the search path is built from the specified drive and from the current directory for this drive.
<Options>: Combination of Integer constants Option used to define the information returned as well as the type of iteration performed for the directory files:
| | fdFullInformation | Each line (separated by carriage return - CR) contains the following information:
<Nom du fichier complet> + TAB + <Taille en octets> + TAB + <Date de dernière modification> + TAB + <Attributs du fichier> The date is in YYYYMMDDHHmmSS format. The attributes are identical to the ones returned by fAttribute. | fdInterruptible | The iteration can be interrupted by pressing ESC. The function will return the name of the listed files until the interruption. | frNoHiddenDirectory | If the frFullInformation constant is used, the hidden directories are not listed (attribute = "H"). | frNoHiddenFile | If the frFullInformation constant is used, the hidden files are not listed (attribute = "H"). | frNotRecursive | The iteration is non-recursive. Subdirectories are ignored. | frRecursive (Default value) | The iteration is recursive. Subdirectories are automatically taken into account. | fUnicodePath | <Result> will be a string in Unicode format. |
Remarks Handling errors Caution: fListFile does not return an error code.. To determine if this function has generated an error, use ErrorInfo with the errMessage constant.
Related Examples:
|
Unit examples (WINDEV): The fListFile function
[ + ] Using fListFile and its syntax that directly returns the list of files/directories found in string format.
|
This page is also available for…
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|