5 procFile = open(filename)
11 def __init__(self, index):
15 bus = (self.index & 2)
16 target = (self.index & 1)
18 #perhaps this is easier?
19 self.prochdx = "/proc/ide/hd" + ("a","b","c","d","e","f","g","h")[index] + "/"
20 self.devidex = "/dev/ide/host" + str(host) + "/bus" + str(bus) + "/target" + str(target) + "/lun8/"
23 procfile = tryOpen(self.prochdx + "capacity")
28 line = procfile.readline()
39 procfile = tryOpen(self.prochdx + "model")
44 line = procfile.readline()
50 procfile = tryOpen("/proc/mounts")
57 line = procfile.readline()
60 if line.startswith(self.devidex):
61 parts = line.strip().split(" ")
63 stat = os.statvfs(parts[1])
66 free = stat.f_bfree/1000 * stat.f_bsize/1000
71 def numPartitions(self):
73 idedir = os.listdir(self.devidex)
77 for filename in idedir:
78 if filename.startswith("disc"):
80 if filename.startswith("part"):