File_FindFile
Description
Section titled “Description”Find the paths containing the specified file
Syntax
Section titled “Syntax”File_FindFile(sFileName, sStartDirectory, bIncludeSubDirectories) As Boolean
Parameters
Section titled “Parameters”sFileName (String)
Section titled “sFileName (String)”File name to search for, without a path. Wildcards aren’t supported. The comparison isn’t case-sensitive.
sStartDirectory (String)
Section titled “sStartDirectory (String)”Directory to start search within
bIncludeSubDirectories (Boolean)
Section titled “bIncludeSubDirectories (Boolean)”Set to TRUE if sub folders should be included in the search. In the current version of the library, this parameter has no effect: the search always includes all subfolders.
Return value
Section titled “Return value”The full path of each file found, for example C:\Temp\Logs\CapaInstaller.txt, is stored in gaValue. The last element of gaValue is always empty, so the number of files found is UBound(gaValue). The function returns True also when no files are found.
Remarks
Section titled “Remarks”The search covers the subfolders of sStartDirectory, at all levels. A file placed directly in sStartDirectory isn’t found. To check that folder, use File_ExistFile.
Example
Section titled “Example”If bStatus Then bStatus = File_FindFile("CapaInstaller.txt", "C:\", True)If bStatus Then For index = 0 To UBound(gaValue) - 1 bStatus = Job_WriteLog("Custom", "The file was found: " & gaValue(index), bStatus, True) NextEnd IfRelated functions
Section titled “Related functions”File_CreateEmptyFile File_CreateDirectory File_DelTree File_DelFile File_ExistDir Constants Package Property Variables