mirror of
https://github.com/moparisthebest/SickRage
synced 2024-12-13 11:32:20 -05:00
Merge pull request #650 from dhellwich/patch-1
Fix for symlinking during Post-Processing
This commit is contained in:
commit
b4981317a8
@ -462,16 +462,12 @@ def hardlinkFile(srcFile, destFile):
|
||||
copyFile(srcFile, destFile)
|
||||
|
||||
|
||||
def symlink(srcFile, destFile):
|
||||
def symlink(src, dst):
|
||||
if os.name == 'nt':
|
||||
import ctypes
|
||||
|
||||
if ctypes.windll.kernel32.CreateSymbolicLinkW(unicode(destFile), unicode(srcFile),
|
||||
1 if os.path.isdir(srcFile) else 0) in [0,
|
||||
1280]:
|
||||
raise ctypes.WinError()
|
||||
else:
|
||||
os.symlink(srcFile, destFile)
|
||||
if ctypes.windll.kernel32.CreateSymbolicLinkW(unicode(dst), unicode(src), 1 if os.path.isdir(src) else 0) in [0,1280]: raise ctypes.WinError()
|
||||
else:
|
||||
os.symlink(src, dst)
|
||||
|
||||
|
||||
def moveAndSymlinkFile(srcFile, destFile):
|
||||
|
Loading…
Reference in New Issue
Block a user