Python NTFS Links Module
What is it?
A ctypes based Python module for manipulating reparse points (junctions/symbolic links/etc) and hard links on the Windows version of Python. Originally this was written to be a C-extension, but ctypes appears to be the more portable solution. At the moment, this project is still a work in progress, and is being rewritten from the ground up to utilize on ctypes. It currently supports the manipulation of junction points, symbolic links, and the ability to check for support of symbolic links.
While symbolic links are officially only supported on Windows Vista and higher, Windows XP users can also utilize them by installing a custom driver:
I have nothing to do with that project, but I did go ahead and add logic for checking for it in the functions dealing with symbolic link support.
Ignore below. The setup doesn't work at the moment, as I've begun rewriting this project from scratch. If you need some functionality already implemented, feel free to just grab what you need from the code.
Standard module building command.
To build in the local directory:
Or to install:
Much of the code was derived by reimplementing pieces of the reparselib, who's full source code can be found at reparselib.
Additionally, thanks goes out to the following Stack Overflow users for explaining a few concepts/methods to me:
- Using a struct as a function argument with the python ctypes module
- Programmatically finding the target of a Windows Hard link
See the project issues.