How to determine that if a folder is empty?

could ildg could.net at gmail.com
Mon Aug 8 01:13:32 EDT 2005


I want to check if a folder named "foldername" is empty.
I use os.listdir(foldername)==[] to do this,
but it will be very slow if the folder has a lot of sub-files.
Is there any efficient ways to do this?
Thanks~



More information about the Python-list mailing list