The SDL Component Suite is an industry leading collection of components supporting scientific and engineering computing. Please visit the SDL Web site for more information....



FileDetect


Unit:SDL_filesys
Class:none
Declaration:function FileDetect (FileMask: string): string;

The function FileDetect recursively searches for a file which matches the string specified in the parameter FileMask. The parameter FileMask may contains wildcards in the filename and extension but not in the path. The function returns an empty string if no file matches the mask. On success, the fully qualified filename of the first matching file is returned.

Hint 1: The function FileDetect may require considerable time when called on a large disk volume and using a file mask containing a path with many subdirectories (i.e. the root directory).

Hint 2: Be careful when using UNCs. A UNC is defined as //host/share/path. If you omit either the host or the share FileDetect won't work and will return an empty string.


Last Update: 2013-Sep-20