Re: Getting directory size

2005-03-21 Thread P
francisl wrote: How can we get a full directory size (sum of all his data)? like when we type `du -sh mydir` Because os.path.getsize('mydir') only give the size of the directory physical representation on the disk. Have a look at: http://www.pixelbeat.org/scripts/dutop Pádraig. -- http://mail.pyth

Re: Getting directory size

2005-03-21 Thread Graham Fawcett
Peter Hansen wrote: > francisl wrote: > > How can we get a full directory size (sum of all his data)? > > like when we type `du -sh mydir` > > > > Because os.path.getsize('mydir') only give the size of the directory > > physical representation on the disk. > > os.popen('du -sh mydir') would be one

Re: Getting directory size

2005-03-21 Thread Peter Hansen
francisl wrote: How can we get a full directory size (sum of all his data)? like when we type `du -sh mydir` Because os.path.getsize('mydir') only give the size of the directory physical representation on the disk. os.popen('du -sh mydir') would be one approach. The harder way is to use os.walk('m