On Wednesday 26 March 2008 09:11, Tom Tucker wrote: > Hello all. I'm looking for a builtin Python library capable of providing > similar output to what the unix df command provides. Obviously, I'm trying > to avoid a system call if possible. I'm looking for the following fields > at a mimimum, total size, used, and /path. Suggestions? I was looking at > os.stat(/path)[WXYZ}, and os.path.getsize, but they are lacking. > > Thanks for the help, > > Tom
You need to know the size of the blocks that the filesystem uses. Use the statvfs module and the os.statvfs function. Cheers _______________________________________________ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor