How to determine that if a folder is empty?

Bernhard Herzog bh at intevation.de
Mon Aug 8 12:37:20 EDT 2005


jepler at unpythonic.net writes:

> On standard Unix fileystems, one way to check for this is to check that the
> st_nlink of the directory is 2. 

In that case you only know that the directory doesn't have any
subdirectories.  It may still contain ordinary files and other
non-directories.

   Bernhard

-- 
Intevation GmbH                                 http://intevation.de/
Skencil                                           http://skencil.org/
Thuban                                  http://thuban.intevation.org/



More information about the Python-list mailing list