From RAD Studio API Documentation
Jump to: navigation, search


function AnsiCompareFileName(const S1: PChar; Len1: Integer; const S2: PChar; Len2: Integer; CheckVolumeCase: Boolean): Integer;
function AnsiCompareFileName(const S1: string; Len1: Integer; const S2: string; Len2: Integer; CheckVolumeCase: Boolean): Integer;
function AnsiCompareFileName(const S1, S2: string; CheckVolumeCase: Boolean): Integer;


extern DELPHI_PACKAGE int __fastcall AnsiCompareFileName(const System::WideChar * S1, int Len1, const System::WideChar * S2, int Len2, bool CheckVolumeCase = false)/* overload */;


Type Visibility Source Unit Parent
function public
System.SysUtils System.SysUtils


Compares file names, based on the current locale.

AnsiCompareFileName compares two file names. The current locale controls the comparison operation. Comparison is case-insensitive under Windows, case-sensitive under MAC OS.

The return value is one of the following:

Condition Return Value
S1 > S2 > 0
S1 < S2 < 0
S1 = S2 = 0

AnsiCompareFileName supports the idiosyncrasies of MS-DOS file names that use Zenkaku Moji, a character encoding used in some Asian locales.

Under Windows locales that do not use Multi-Byte Character Sets (MBCS), AnsiCompareFileName is identical to AnsiCompareText.

Under MAC OS and Linux, AnsiCompareFileName is identical to AnsiCompareStr.

See Also