[Thunar-dev] show total directory sizes?

Benedikt Meurer benedikt.meurer at unix-ag.uni-siegen.de
Fri Mar 24 23:59:57 CET 2006


Benedikt Meurer wrote:
>>>It should be a simple job, which uses one or more threads to determine
>>>the size of a directory using opendir(), readdir(), closedir() and lstat().
>>
>>You can start with the xfburn code (taken from gnomebaker in fact). I'm
>>sure you'll find ways to improve it.
> 
> This is definitely the simplest solution, but it's not suitable for
> Thunar, as it uses too much memory when calculating the total size of a
> large directory tree.

... but on the other hand, the simplest solution is not always the worst
solution. And so, I used your code with a simple trick to not allocate a
struct stat in every stack frame (as the thread stack is very limited on
several platforms). ;-)

http://www.xfce.org/~benny/tmp/thunar-dir-size.png

> Benedikt

Benedikt



More information about the Thunar-dev mailing list