-
Notifications
You must be signed in to change notification settings - Fork 18.3k
Closed
Labels
Milestone
Description
- Go Version: go1.4.2 windows/amd64
- OS and Arch: Windows 8.1 Pro 64-bit.
- Action:
os.Stat("Path\to\deduped.file")
- Expected Result: successfully returns (FileInfo, nil)
- Actual Result:
err := "readlink Path\to\deduped.file: The system cannot find the file specified."
From a bit of digging, the issue is caused by NTFS Dedupe using reparse points for deduplicated files. The Windows implementation of fileStat.Mode() treats all reparse points as symlinks, however there are several other cases to consider, including Deduplication and Mount Points, neither of which are symlinks.
The Windows implementation of os.Readlink() already performs a sanity check to ensure that it is handling a symlink. Ideally a similar inspection could be performed in Mode(), checking for IO_REPARSE_TAG_DEDUP == 0x80000013
and stripping the Symlink flag, allowing the file to be treated as Regular.