Im writing a program in python for sorting my huge folder with a lot of junk, but also some good pictures that I would like to keep and sort by some parameters into an album.
Im not very good at programming, but I should be able to get this one right (but looks like im wrong lol).
This is the case: When selecting the pictures, and sorting them in a new dedicated folder. The program reports every picture was moved. And there is no pictures left in the source folder, but 1 or 2 pictures are missing when i check folder created with all the moved pictures.
I'v tried to check that the file is removed from source and is created in destination like this
I use shutil and a counter to move, and count every moved file like:
shutil.move(src, dest)
movedFiles += 1
if not created in new destination:
if not path.isfile(newFile):
print(...)
and
if not removed from old destination:
if path.isfile(oldFile):
print(...)
I dont know if this is sufficient information to see any problems or errors i should check, please let me know. Im new here, so im kind of a noob :|
What is the best way to start error searching something like this? Its about 5k files and there might be some copies with the same name, but stored in different folders, so i can't just search by names either. Maybe i could try to hash the images and search for which hash is missing?