diff --git a/ospd/ospd.py b/ospd/ospd.py index 4ef685b..c6e9843 100644 --- a/ospd/ospd.py +++ b/ospd/ospd.py @@ -25,6 +25,7 @@ import multiprocessing import os from pathlib import Path import re +import shutil import socket import ssl import time @@ -136,7 +137,10 @@ class OSPDaemon: for dp in root.glob('*'): if is_uuid_re.match(dp.name): if dp.exists(): - dp.unlink() + try: + shutil.rmtree(str(dp)) + except: + os.remove(dp) return self.scan_collection = ScanCollection(file_storage_dir)