Korthrun korthrun at
Mon Oct 29 22:52:12 CET 2007

I'm writing some scripts to populate RRD's, mainly for practicing python.

As such I've decided to play with statvfs in order to build disk
graphs. Here is what I have and what I get. What I'm curious about
here is the meaning of the "L" charcter, as that fubars math.

###start code###

from os import statvfs, path
from statvfs import *

mps = [ '/', '/home', '/www', '/var', '/storage/backups',
'/storage/snd' ]

for fs in mps:
	data = statvfs(fs)
	print data

###end code, start output###
(4096, 4096, 4883593L, 4045793L, 4045793L, 0L, 0L, 0L, 1024, 255)
(4096, 4096, 1220889L, 1114718L, 1114718L, 0L, 0L, 0L, 0, 255)
(4096, 4096, 19267346L, 18273138L, 18273138L, 0L, 0L, 0L, 0, 255)
(4096, 4096, 3662687L, 3492397L, 3492397L, 0L, 0L, 0L, 0, 255)
(4096, 4096, 3417702L, 2116063L, 2116063L, 0L, 0L, 0L, 0, 255)
(4096, 4096, 25885944L, 21799115L, 21799115L, 0L, 0L, 0L, 0, 255)
###end output###

Ideally I'll just do some blocksize * number of blocks math to get
the % of used space. I know I could just .strip() the L, but I'd
to know what it means



More information about the Python-list mailing list