fix #667 硬链接支持极空间
This commit is contained in:
@ -61,7 +61,9 @@ class SystemUtils:
|
|||||||
移动
|
移动
|
||||||
"""
|
"""
|
||||||
try:
|
try:
|
||||||
|
# 当前目录改名
|
||||||
temp = src.replace(src.parent / dest.name)
|
temp = src.replace(src.parent / dest.name)
|
||||||
|
# 移动到目标目录
|
||||||
shutil.move(temp, dest)
|
shutil.move(temp, dest)
|
||||||
return 0, ""
|
return 0, ""
|
||||||
except Exception as err:
|
except Exception as err:
|
||||||
@ -74,7 +76,11 @@ class SystemUtils:
|
|||||||
硬链接
|
硬链接
|
||||||
"""
|
"""
|
||||||
try:
|
try:
|
||||||
dest.hardlink_to(src)
|
# link到当前目录并改名
|
||||||
|
tmp_path = src.parent / dest.name
|
||||||
|
tmp_path.hardlink_to(src)
|
||||||
|
# 移动到目标目录
|
||||||
|
shutil.move(tmp_path, dest)
|
||||||
return 0, ""
|
return 0, ""
|
||||||
except Exception as err:
|
except Exception as err:
|
||||||
print(str(err))
|
print(str(err))
|
||||||
|
Reference in New Issue
Block a user