This example tries to normalize casing of filename. Result is OK for filename part, but path-part is not normalized.
{$mode objfpc}{$h+}
program project1;
uses
SysUtils,
StrUtils;
var
s: string;
m: TFilenameCaseMatch;
begin
s:= 'c:\WORK\up_ALL.BAT';
writeln(ExpandFileNameCase(S, m));
end.
It shows 'C:\WORK\up_all.bat'; I want the casing of path 'C:\Work' ('dir' in console shows 'Work').