Reputation: 334
This is what I do but takes forever:
>>> import shutil,os
>>> for d in os.listdir("."):
... if os.path.isdir(d):
... shutil.rmtree(d)
Directories are full of files in the order of several thousands files.
What is the fastest way to do it instead?
Upvotes: 0
Views: 1096
Reputation: 30167
Unfortunately that's FS speed-bound. There's no real way to speed it up if directories are filled up with many files.
Upvotes: 5