Python Script To Copy Files Recursively

I was working on a huge data restore which left me with 500 GB of data in around 5000 directories. I wrote this little python script to rip all the files into a single directory so I could export to a drive and find files more easily.

Not 100% sure on the win version, so YMMV.

anyways, here it is:

2 Likes

Huh, fun idea, but 5000 folders into one would be like chopping a forest down then looking for one of the leaves? Would it actually be easier to find anything, or would you later sort the files back into fewer folders later?

I find that naming directories into years with month subdirectories make more sense if you are accumulating files rapidly

I also append files with searchable filenames.

What does this do that cp doesn’t?

While I get naming the folders, this was for a user who is less advanced who simply needs to be able to click the sort at the top of windows, wait a bit and then find the particular file types.

Otherwise I would have just sent them the pile of res## folders.

Either way, it’s a project someone can modify to their uses which is the only reason I shared it.

2 Likes

second person to berate me for not using cp

wanted to do it in python for one thing

3 Likes

I’m not trying to berate or insult you, it is a genuine question.

2 Likes

Congrats on a code project, just doing anything is a good thing, as it’s practice if nothing else.

Also, I use my bedroom floor like my idiot brother’s desktop folder.
Everything stored latterally. lots of items, horrendous seek times.

3 Likes