You are not logged in.
We found a critical problem in FPC 3.2 FileExists RTL function under Windows
In case file is placed on the NTFS file system with de-duplication enabled and is de-duplicated (FILE_ATTRIBUTE_REPARSE_POINT attribute is sets for file) then FileExists(fileName) always returns False.
The solution is to use FileExists(fileName, false) to disable FollowLink check.
Offline
Won't it break existing code if we put an alias around FileExists() to force FollowLink=false in our framework?
Following you feedback, I am tempted, at least for mORMot 2, to define a FileExists() in mormot.core.os.pas for Windows, on both FPC and Delphi.
We could just call GetFileAttributesA/GetFileAttributesW for fast and simple check.
Will it work in your case?
Offline
We found a critical problem in FPC 3.2 FileExists RTL function under Windows
Would you please test whether this also happens with 3.2.1, cause I fixed the reparse point handling a few months ago and merged it to fixes?
Free Pascal Compiler Core developer
Offline
Unfortunately I can't verify it now - since a problem occurs on the production environment I do not have access to I ask their administrator to remove a de-duplication.
One thing I noticed - all deduplicated files have both FILE_ATTRIBUTE_REPARSE_POINT and FILE_ATTRIBUTE_SPARSE_FILE attributes enabled. May be this is a way to simplify a current implementation ( I mean in this line - https://github.com/graemeg/freepascal/b … s.pp#L565)
Once I got access to some deduplicated FS I will verify your patch
Offline