I'm working with the shutil.copy
method in python.
I found the definition listed below:
def copyFile(src, dest):
try:
shutil.copy(src, dest)
# eg. src and dest are the same file
except shutil.Error as e:
print('Error: %s' % e)
# eg. source or destination doesn't exist
except IOError as e:
print('Error: %s' % e.strerror)
I'm accessing the definition inside a loop. The loop is based on a string that changes each time. The code looks at all the files in the directory, and if it sees a part of the string in the file, it copies it to a new location
I am pretty sure that there will be duplicate files. So I was wondering what will happen.
Will they be copied, or will they fail?