This function copies files from one folder to another acording to filetype. The problem is when the number of files is so big that it takes too long to copy. Maybe there is another way of doing it? Using another library/language/syntax?
def main_copy(source, destination):
# List of all files inside directory
files_fullpath = [f for f in listdir(source)
if isfile(join(source, f))]
# Copy files to the correct folder according to filetype
if len(files_fullpath) != 0:
for fs in files_fullpath:
full_file = source + "\\" + fs
if str(fs).endswith('.ARW'):
shutil.copy(full_file, raw_folder + "\\" + fs)
else:
shutil.copy(full_file, jpg_folder + "\\" + fs)
if len(listdir(destination)) != 0:
print("Files moved succesfully!")