RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
SysUtils.ExpandFileNameCase Function

Returns the full path name for a relative file name on a case-sensitive file system.

Pascal
function ExpandFileNameCase(const FileName: string; out MatchFound: TFilenameCaseMatch): string; overload;
C++
AnsiString ExpandFileNameCase(const AnsiString FileName, TFilenameCaseMatch MatchFound);

ExpandFileNameCase expands a relative file name into a fully qualified path name, then attempts to find the file or a close case-insensitive match. This is useful when converting file name data from case-insensitive conventions (Windows) to case-sensitive conventions (Linux). It is also useful for validating file names entered by users unfamiliar with Linux conventions. 

FileName is the relative file name to expand. 

MatchFound indicates what match, if any, was found for FileName. 

The return value is the fully qualified path name generated by ExpandFileNameCase. Its relationship to FileName depends on the value of MatchFound, as indicated in the following table:

MatchFound 
Return value 
mkNone  
The fully qualified path name, as returned by ExpandFileName.  
mkExactMatch  
The fully qualified path name for the single case-sensitive match to FileName. This is the same value as the one returned when MatchFound is mkNone.  
mkSingleMatch  
(Linux only.) The fully qualified path name for the single file that matches FileName case-insensitively.  
mkAmbiguous  
(Linux only.) The fully qualified path name for one of the case-insensitve matches to FileName. This path name is not the same as the specified file, and not necessarily the closest match.  

Note: ExpandFileNameCase is much slower than ExpandFileName, particularly when the specified file name is ambiguous or does not match an actual file.
 

Copyright(C) 2009 Embarcadero Technologies, Inc. All Rights Reserved.
What do you think about this topic? Send feedback!