Pythonic fun

One of the problems I’ve had in situations involving music and being away from my desktop is I don’t have access to my entire music collection. Somehow the thought of dragging and dropping my entire collection in Windows only to have it say the network was interupted after it’s been copying for 30 hours and not tell me how far it’s got didn’t seem appealing.

Python to the rescue. I’ve knocked together a script which goes through my collection and copies it to another location. It seems to do it at a reasonable speed too, way faster than Windows seems to manage it. It scans though my collection and checks if it exists in the new location and if not, copies it over. To allow it to be interrupted it also checks existing files to make sure they are the same size so if a file was only half copied when the script was interrupted it will copy it back over again.

The only functionality I could do to add now would be to scan through the new collection and make sure files were in there that weren’t in the old collection (if for example they had been deleted or more usually, if they were moved as the new location would have been seen as new files and copied over by the script) and if so, delete them.

Timeline

Newsletter

Don't have time to check my blog? Get a weekly email with all the new posts. This is my personal blog, so obviously it is 100% spam free.

Metadata

This entry was posted on Wednesday, March 7th, 2007 at 9:47 am and is filed under Life. You can follow any responses to this entry through the RSS 2.0 feed. Both comments and pings are currently closed.