Last active
December 16, 2015 06:19
-
-
Save maphew/5390078 to your computer and use it in GitHub Desktop.
Create file hardlinks in python in a platform independent way. [untested] Courtesy of Dieter Deyke, http://www.gossamer-threads.com/lists/python/python/517542#517542
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
def createHardLink(src, dst): | |
import ctypes | |
if not ctypes.windll.kernel32.createHardLinkA(dst, src, 0): raise OSError | |
os.link = createHardLink |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment