emulating du with os.walk

Kirk Job-Sluder kirk at eyegor.jobsluder.net
Mon Sep 27 01:58:47 EDT 2004


On 2004-09-27, Martin v. Löwis <martin at v.loewis.de> wrote:
> 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.

Yeah, I finally solved it with a recursive function.  Took me 16
including the bookeeping.

>
> Regards,
> Martin


-- 
Kirk Job-Sluder
"The square-jawed homunculi of Tommy Hilfinger ads make every day an
existential holocaust."  --Scary Go Round



More information about the Python-list mailing list