With Lazarus RC2 (and I think before too) "FileExistsUTF8" uses "_FileGetAttrUtf8" which again uses FileGetAttrWide (on Windows if Unicode is enable) which again uses "Windows.GetFileAttributesW(PWideChar(UTF8Decode(FileName)))"
but this fails for long paths (if Length(FileName)>255). Why not prepend "\\?\" at this last Windows step so it works for long paths too? BTW: I am not sure whether this leads to errors but while the result of the Windows API-function GetFileAttributesW is declared to be DWORD this result is converted (or is ist just typecasted?) to Integer in function FileGetAttrWide(const FileName: String): Longint; begin Result:=Integer(Windows.GetFileAttributesW(PWideChar(UTF8Decode(FileName)))); end; Doesn't this provoke at least a range check errors? What happens when I compare the integer result with (DWORD) constants which havbe the first bit set? This seems to be done at many places with many DWORD results from Windows API functions. Is this a bug? -- _______________________________________________ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus