copy using os call if python<3.14

This commit is contained in:
George Lacey 2025-11-23 12:46:15 +00:00
parent e730ed5eb3
commit 878f740bde

View File

@ -1,5 +1,6 @@
import argparse
from pathlib import Path
import os
SAFETY = 'jellyfin'
@ -62,7 +63,10 @@ def create_new_links(source: Path, dest: Path, dry: bool):
if dry:
print(f"Create file: {new_file}")
else:
try:
file.copy(new_file)
except AttributeError:
os.system(f"cp --reflink {file} {new_file}")
if __name__ == '__main__':
args = get_args()