Merge pull request #1243 from abeloin/patch-rename_across_partition
Fix moving files across partition
This commit is contained in:
commit
8432c82544
|
@ -355,7 +355,7 @@ def copyFile(srcFile, destFile):
|
|||
|
||||
def moveFile(srcFile, destFile):
|
||||
try:
|
||||
ek.ek(os.rename, srcFile, destFile)
|
||||
ek.ek(shutil.move, srcFile, destFile)
|
||||
fixSetGroupID(destFile)
|
||||
except OSError:
|
||||
copyFile(srcFile, destFile)
|
||||
|
@ -399,7 +399,7 @@ def symlink(src, dst):
|
|||
|
||||
def moveAndSymlinkFile(srcFile, destFile):
|
||||
try:
|
||||
ek.ek(os.rename, srcFile, destFile)
|
||||
ek.ek(shutil.move, srcFile, destFile)
|
||||
fixSetGroupID(destFile)
|
||||
ek.ek(symlink, destFile, srcFile)
|
||||
except:
|
||||
|
@ -491,7 +491,7 @@ def rename_ep_file(cur_path, new_path, old_path_length=0):
|
|||
# move the file
|
||||
try:
|
||||
logger.log(u"Renaming file from " + cur_path + " to " + new_path)
|
||||
ek.ek(os.rename, cur_path, new_path)
|
||||
ek.ek(shutil.move, cur_path, new_path)
|
||||
except (OSError, IOError), e:
|
||||
logger.log(u"Failed renaming " + cur_path + " to " + new_path + ": " + ex(e), logger.ERROR)
|
||||
return False
|
||||
|
|
Loading…
Reference in New Issue