dotnet/runtime
View on GitHubNTFS volume on Linux - junction does not work properly
Open
#20,874 opened on Apr 3, 2017
area-System.IObughelp wantedos-linux
Repository metrics
- Stars
- (17,886 stars)
- PR merge metrics
- (Avg merge 12d 11h) (661 merged PRs in 30d)
Description
Manifestations:
DirectoryInfo.Attributesdoes not include ReparsePointDirectoryInfo.Deletefails - see dotnet/corefx#17844
Given this directory structure on an NTFS volume
E:.
+---sub
| | sym-to-other
| |
| +---junction-to-other
| |
| \---symd-to-other
|
\---sub_other
running dir from the Windows command line shows
04/02/2017 05:27 PM <JUNCTION> junction-to-other [\??\E:\link-test\sub_other]
04/02/2017 05:27 PM <SYMLINK> sym-to-other [E:\link-test\sub_other]
04/02/2017 05:27 PM <SYMLINKD> symd-to-other [..\sub_other]
Moving the NTFS device to a Linux box, ls -a from bash shows
lrwxrwxrwx 2 jeff jeff 72 Apr 3 14:10 junction-to-other -> /media/jeff/My Book/link-test/sub_other
lrwxrwxrwx 2 jeff jeff 68 Apr 3 14:10 symd-to-other -> ../sub_other
lrwxrwxrwx 2 jeff jeff 116 Apr 3 14:10 sym-to-other -> /media/jeff/My Book/.NTFS-3G/E:/link-test/sub_other
Invoking the DirectoryInfo constructor with "junction-to-other" results in a DirectoryInfo object whose Attributes property contains Directory, but not ReparsePoint. Constructors giving the other two types of symbolic link behave as expected.
var d = new DirectoryInfo("symd-to-other"); // OK, Attributes has Directory | ReparsePoint
var s = new DirectoryInfo("sym-to-other"); // OK, Attributes has ReparsePoint
var j = new DirectoryInfo("junction-to-other"); // Bad, Attributes has Directory, but not ReparsePoint