System.SysUtils.ExpandFileNameCase
Delphi
function ExpandFileNameCase(const FileName: string; out MatchFound: TFilenameCaseMatch): string;
C++
extern DELPHI_PACKAGE System::UnicodeString __fastcall ExpandFileNameCase(const System::UnicodeString FileName, /* out */ TFilenameCaseMatch &MatchFound)/* overload */;
Properties
| Type | Visibility | Source | Unit | Parent |
|---|---|---|---|---|
| function | public | System.SysUtils.pas System.SysUtils.hpp |
System.SysUtils | System.SysUtils |
Description
Returns the full path name for a relative file name on a case-sensitive file system.
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 (on Windows) to case-sensitive conventions (on MacOS and Linux). It is also useful for validating file names entered by users unfamiliar with MacOS 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
FileName. This is the same value as the one returned when MatchFound is mkNone.
FileName case-insensitively.
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.