PM Torsten Bonde Christiansen wrote 13 lines
No entirely though. The Unix version is mostly a wrapper, yes - but the
Windows version do some additional filtering:
function FileExistsUTF8(const Filename: string): boolean;
var
Attr: Longint;
begin
Attr := FileGetAttrUTF8(FileName);
if Attr -1 then
Result:= (Attr and FILE_ATTRIBUTE_DIRECTORY) = 0
else
Result:=False;
end;
Not anymore in trunk:
function FileExistsUTF8(const Filename: string): boolean;
begin
Result := SysUtils.FileExists(Filename);
end;
This will return False for directories.
(The test for (Attr and FILE_ATTRIBUTE_DIRECTORY) = 0 is done by fpc now).
On *nix everything is a file, so folders are reported to be files as well AFAIK.
Bart
--
Bart