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
Creating a DirectoryInfo object for "junction-to-other" results in an object whose Attributes property has Directory. However, invoking Delete() on that object throws a System.IO.IOException with HRESULT == 20, and Message == "Not a directory".
Invoking Delete() on objects created for the other two symbolic links successfully deletes the items.
Given this directory structure on an NTFS volume
running
dirfrom the Windows command line showsMoving the NTFS device to a Linux box,
ls -afrom bash showsCreating a
DirectoryInfoobject for"junction-to-other"results in an object whoseAttributesproperty hasDirectory. However, invokingDelete()on that object throws aSystem.IO.IOExceptionwithHRESULT == 20, andMessage == "Not a directory".Invoking
Delete()on objects created for the other two symbolic links successfully deletes the items.