mirror of
https://github.com/boykopovar/AnyPS5.git
synced 2026-10-22 00:22:57 -05:00
lstat and readlink threw NotImplemented for every Windows reparse point other than a symbolic link or a drive junction. A tag without the name surrogate bit (cloud files, deduplication) does not stand for another path, so lstat now answers as stat does and readlink returns EINVAL, as FreeBSD does for a file that is not a link and as CPython's os.lstat and os.readlink do (bpo-37834). A name surrogate that is neither a symbolic link nor a junction (a mounted volume, a WSL link) is reported as the reparse point itself with the mode of its attributes, and readlink returns EINVAL. The tests set reparse tags with FSCTL_SET_REPARSE_POINT, one without the name surrogate bit and one with it. A compact /exe (WOF) file cannot serve as the fixture: on Windows 11 24H2 the WOF filter hides the reparse point from GetFileAttributesW and FileAttributeTagInfo alike. Windows refuses every open of an unhandled tag without FILE_FLAG_OPEN_REPARSE_POINT, so the test requires lstat to agree with stat rather than to succeed. mashingaan's boykopovar/AnyPS5#6447 returned EINVAL for other reparse points without the tag check. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>