fix division by zero if less than 100 files are copied

This commit is contained in:
the1311 2021-11-16 23:06:11 +01:00
parent f59c7bf8cd
commit ee18f84d11
1 changed files with 4 additions and 1 deletions

View File

@ -90,7 +90,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)