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()