Fix for symlinking during Post-Processing

As described here: https://sickrage.tv/forums/forum/help-support/bug-issue-reports/5016-several-issues
This commit is contained in:
dhellwich 2014-07-20 21:47:37 +02:00
parent f6d662ca6b
commit aba5cc10d2

View file

@ -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()
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(srcFile, destFile)
os.symlink(src, dst)
def moveAndSymlinkFile(srcFile, destFile):