ibec_GetFiles

Retrieves specified file or list of files.

Syntax

 function ibec_GetFiles(files_list, 'path'\, 'file_name', _gfXXX + __gfXXX);

There are six __gfXXX constants:

__gfRecursiveSearchThe search will be performed recursively for each directory. For example, if D:\ is specified as the initial path for the search, the function will search also in D:\MyData, in D:\MyPhotos, in D:\MyPhotos\Last etc. In this case the entire D: drive will be scanned.
__gfFullNameThe file names in the result list will include the full path, otherwise only the file name (without the drive letter and directories) will be listed.
__gfAppendThis is useful when you perform several searches one by one with different conditions. If this option is specified the function will NOT clear the result list before performing a new search, new results will be added to the files_list. Otherwise the files_list variable will be erased before searching.
__gfSortThis allows you to sort a list of files.
__gfDirectoriesUse this option to get the list of subdirectories instead of the files. (See example below.)
__gfUTF8The __gfUTF8 option returns a list of files/directories in UTF8. Mask and Path parameters can be also specified in UTF8. The necessary checks and conversion are performed automatically. (See example below.)

Please note that the PATH parameter should be suffixed with a backward slash (\), otherwise it will return NULL.

Example 1

 ibec_GetFiles(FilesLst, 'D:\MyData', '*.*', __gfFullName + __gfRecursiveSearch + __gfSort);

Example 2

 DirCount =  ibec_GetFiles(DirList, 'D:\MyData\', '*.*', __gfSort + __gfFullName + __gfDirectories);

Example 3

 ibec_GetFiles(Dirs, 'D:\Pictures\', '*.*', __gfSort + __gfDirectories + __gfFullName + __gfUTF8);

See also:
Inserting file data into a database

back to top of page
<< ibec_FileSize | IBEBlock | ibec_LoadFromFile >>