diff --git a/recovery.py b/recovery.py index 459e663..d83a4d8 100755 --- a/recovery.py +++ b/recovery.py @@ -102,14 +102,20 @@ for root, dirs, files in os.walk(source, topdown=False): extension = os.path.splitext(file)[1][1:].upper() sourcePath = os.path.join(root, file) - destinationDirectory = os.path.join(destination, extension) + if extension: + destinationDirectory = os.path.join(destination, extension) + else: + destinationDirectory = os.path.join(destination, "_NO_EXTENSION") if not os.path.exists(destinationDirectory): os.mkdir(destinationDirectory) if keepFilename: fileName = file else: - fileName = str(fileCounter) + "." + extension.lower() + if extension: + fileName = str(fileCounter) + "." + extension.lower() + else: + fileName = str(fileCounter) destinationFile = os.path.join(destinationDirectory, fileName) if not os.path.exists(destinationFile):