copy using os call if python<3.14
This commit is contained in:
parent
e730ed5eb3
commit
878f740bde
|
|
@ -1,5 +1,6 @@
|
||||||
import argparse
|
import argparse
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
import os
|
||||||
|
|
||||||
|
|
||||||
SAFETY = 'jellyfin'
|
SAFETY = 'jellyfin'
|
||||||
|
|
@ -62,7 +63,10 @@ def create_new_links(source: Path, dest: Path, dry: bool):
|
||||||
if dry:
|
if dry:
|
||||||
print(f"Create file: {new_file}")
|
print(f"Create file: {new_file}")
|
||||||
else:
|
else:
|
||||||
file.copy(new_file)
|
try:
|
||||||
|
file.copy(new_file)
|
||||||
|
except AttributeError:
|
||||||
|
os.system(f"cp --reflink {file} {new_file}")
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
args = get_args()
|
args = get_args()
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user