Task and the background:
To create, read back, remove links to directories (as of now) in win32 platform.
The approach that am following in my python code is, in order
a. Tries to create real symlink, if supported (via mklink cmd)
b. If unsupported, falls back to creating junction pt, if it's supported(via linkd cmd)
Reading and removal follows same approach.
Problem:
Creation and removal of both symlink and junc pt is straightforward, but i couldn't figure out how to read the target i.e. pointing directory.
Progress:
a. For junction points, i can use 'linkd ' and parse the stdout in an ugly manner to get target dir.
b. For symlink there seem to be no such solution.
c. I see that there is native support in python 3.1.1[1] for win32 symlinks but am using v2.7.1 and can't upgrade now.
d. There is method in pywin32 module to create symlink but nothing i could see to read it back
p.s. am pretty new to Python so if there is an alternative approach to easily accomplish this, please let me know.
[1] [http://bugs.python.org/issue1578269][1]