Merge pull request #4 from the1311/fix-div-by-zero-in-recovery.py

fix division by zero if less than 100 files are copied
This commit is contained in:
Lukas Hahmann 2022-08-20 18:20:59 +02:00 committed by GitHub
commit cfd0496a28
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 1 deletions

View File

@ -96,7 +96,10 @@ while ((destination is None) or (not os.path.exists(destination))):
destination = input('Enter a valid destination directory\n')
fileNumber = getNumberOfFilesInFolderRecursively(source)
onePercentFiles = int(fileNumber/100)
if fileNumber > 100:
onePercentFiles = int(fileNumber/100)
else:
onePercentFiles = fileNumber
totalAmountToCopy = str(fileNumber)
print("Files to copy: " + totalAmountToCopy)