sPath | (String) Path where to find the files.
It is recommended to use the PROMOTIC path syntax - see PROMOTIC path to files or folders. |
---|---|
sName | (String) File names that have to be found; "wild" characters * and ? can be used |
nAttr | (Long) Bit attribute. The value is a bit combination:
1 - Don't look in subfolders
2 - Return absolute paths
4 - Find even folders
8 - Find only subfolders; overwrites attribute 4
16 - The output array is sorted by creation time of files
32 - The output array is sorted by file name
64 - The output array is sorted by the file extension
128 - The output array is sorted bottom-up (from the smallest to the biggest = aa, ab, ba, bb, c, d ...). Otherwise the sorting is top-down (from the biggest to the smallest = zz, zy, yz, yy, x, w, ...). Value 0 = means to find only files, not folders.
256 - File names will be returned without the extension
512 - Sorts the output array by the last write time into the file |
var aFiles, nFiles, iFiles;
aFiles = Pm.FileFind("#app:", "*.INI", 1 + 2 + 32 + 128);
nFiles = aFiles.GetSize(1);
for (iFiles = 0; iFiles < nFiles; iFiles++)
{
Pm.Debug(aFiles.GetItem(iFiles));
}
var aFiles, nFiles;
aFiles = Pm.FileFind("#app:", "app.txt", 1 + 2 + 32 + 128);
nFiles = aFiles.GetSize(1);
if (nFiles > 0)
{
Pm.Debug(aFiles.GetItem(0));
// File found
}