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
]]>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?
]]>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?
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.
]]>