From 878f740bde7ca58e994816f112321bf47649b32e Mon Sep 17 00:00:00 2001 From: grglcy Date: Sun, 23 Nov 2025 12:46:15 +0000 Subject: [PATCH] copy using os call if python<3.14 --- cowcopy.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/cowcopy.py b/cowcopy.py index 91fec7a..47df6f9 100644 --- a/cowcopy.py +++ b/cowcopy.py @@ -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: - file.copy(new_file) + try: + file.copy(new_file) + except AttributeError: + os.system(f"cp --reflink {file} {new_file}") if __name__ == '__main__': args = get_args()