Message300450
Junctions are sometimes used as links (e.g. mklink /j) and sometimes as volume mount points (e.g. mountvol.exe). GetVolumePathName can be called to distinguish these cases. If a junction is a volume mount point, then its absolute path and volume path are the same. This test is already used in ntpath.ismount().
For a junction link, islink() should return true, readlink() should work, and S_ISDIR() should return false for the lstat() st_mode. For a junction mount point, islink() should return false, readlink() should not work, and S_ISDIR() should return true for the lstat() st_mode.
A helper function could be added in fileutils.c to determine whether a reparse point is a link, based on the file path and reparse tag. Then modify _Py_attribute_data_to_stat() to take `BOOL is_link` instead of `ULONG reparse_tag`. |
|
Date |
User |
Action |
Args |
2017-08-17 17:56:05 | eryksun | set | recipients:
+ eryksun, paul.moore, tim.golden, zach.ware, steve.dower, vidartf |
2017-08-17 17:56:05 | eryksun | set | messageid: <1502992565.01.0.525137008048.issue31226@psf.upfronthosting.co.za> |
2017-08-17 17:56:04 | eryksun | link | issue31226 messages |
2017-08-17 17:56:04 | eryksun | create | |
|