diff --git a/random_file_picker/core.py b/random_file_picker/core.py index 2ad1423..031a6c6 100644 --- a/random_file_picker/core.py +++ b/random_file_picker/core.py @@ -2,6 +2,7 @@ import fnmatch import io import os import pathlib +import shutil import requests import send2trash @@ -120,7 +121,7 @@ def move_file_to_move_folder(file_path: pathlib.Path) -> None: while destination_path.exists(): destination_path = move_dir_path / f"{name}_{counter}{ext}" counter += 1 - _ = file_path.rename(destination_path) + _ = shutil.move(file_path, destination_path) def trash_file(file_path: pathlib.Path) -> None: """