os.statvfs on FreeBSD

Steve Holden sholden at holdenweb.com
Mon Jun 18 12:25:54 EDT 2001


If you don't want to run this every millisecond, you could run a "df"
command and parse the results.

regards
 Steve
--
http://www.holdenweb.com/


"Tom Messmer" <t_messmer at yahoo.com> wrote in message
news:f74c89ea.0106161951.2e55a814 at posting.google.com...
> Thanks for looking at this, I took some time and noticed that there
> was really no statvfs system call in FreeBSD (stable) and thought it
> might be possible to use the statfs call and map it to the same tuple
> returned by python's os.statvfs routine. Er, but thats as far as I got
> with it so far because I'm new at Python and not much of a programmer
> anyway. I looked at the os module itself and saw that it calls posix
> for unix-like systems, but from there I couldnt tell how it accesses
> system calls. If someone would care to explain this I'd love to hear
> about it, my eyes crossed after staring at all these classes and
> subclasses and sub sub...well you get the picture. All I really need
> is to write some code to grab system disk statistics so my servers
> don't get all full up, and i dont want to use some huge thing like big
> brother or spong.
>
> Thanks for the posts.
> Tom Messmer
>
> charles at aspen.sweetshade.net (Charles Allen) wrote in message
news:<slrn9incpf.feg.charles at aspen.sweetshade.net>...
> > To follow up to my own followup a bit:
> >
> > >>>> os.statvfs("/")
> > > Traceback (most recent call last):
> > >   File "<stdin>", line 1, in ?
> > > AttributeError: 'os' module has no attribute 'statvfs'
> >
> > I should have explained that FreeBSD has no statvfs library routine
> > (at least 4-STABLE, I don't know about 5-CURRENT).  If the original
> > poster would explain the specific info he's looking for, perhaps an
> > alternative can be found.





More information about the Python-list mailing list