On 03May2017 09:13, Ram Rachum <r...@rachum.com> wrote:
Calling `du` is possible but I prefer to avoid these kinds of solutions.
(OS-specific, parsing text output from a third-party program.)

Your choice, and fair enough.

However I'd point out that "du" is available on all UNIX systems (includes MacOS) and UNIXlike systems (Linux in its many forms), and has the advantage that it embodies all the platform specific knowledge you need as alluded to in another reply; hard links, block counts things-not-plain-files and so forth.

Of course, I speak here with some hypocracy because I'm the kind of person who'd write his own for things like this sometimes also. Starting with Python's os.walk function would get you off the ground.

If you end up with something clean and usable by others, publish it to PyPI.

Cheers,
Cameron Simpson <c...@zip.com.au>
_______________________________________________
Python-ideas mailing list
Python-ideas@python.org
https://mail.python.org/mailman/listinfo/python-ideas
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to