[Baypiggies] Number of inodes on a volume?

Ted Nyman tnm800 at gmail.com
Wed Feb 3 02:26:47 CET 2010

I suppose there are a few ways; I'd say statvfs is probably the best way.

If you want to try returning the free bytes, how about:

import os
import statvfs

def get_freebytes(path):
    the_data = os.statvfs(path)
    return the_data[statvfs.F_BSIZE] * the_data[statvfs.F_BFREE]

-Ted Nyman

On Tue, Feb 2, 2010 at 5:13 PM, Glen Jarvis <glen at glenjarvis.com> wrote:

> I have a quick question to this brilliant group :)
> How do I, using pure python, get the number of inodes free on a volume
> for a particular mount?
> Basically, is there an equivalent to df -i in Python? Is this
> somewhere in stat and I can't find it?
> Cheers,
> Glen
> _______________________________________________
> Baypiggies mailing list
> Baypiggies at python.org
> To change your subscription options or unsubscribe:
> http://mail.python.org/mailman/listinfo/baypiggies
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/baypiggies/attachments/20100202/ac8d53fb/attachment-0001.htm>

More information about the Baypiggies mailing list