emulating du with os.walk

"Martin v. Löwis" martin at v.loewis.de
Mon Sep 27 00:59:52 EDT 2004


Kirk Job-Sluder wrote:
> There should be an easy way to get around this, or perhaps I'm better
> off just parsing the output of du.

I suggest that you don't use os.path.walk, but write a recursive
function yourself. You should find that the entire problem can
be solved in 12 lines of Python code.

Regards,
Martin



More information about the Python-list mailing list