[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[minion-cvs] Cope with systems that lack statvfs



Update of /home/minion/cvsroot/src/minion/lib/mixminion
In directory moria.seul.org:/tmp/cvs-serv11424/lib/mixminion

Modified Files:
	Common.py 
Log Message:
Cope with systems that lack statvfs

Index: Common.py
===================================================================
RCS file: /home/minion/cvsroot/src/minion/lib/mixminion/Common.py,v
retrieving revision 1.27
retrieving revision 1.28
diff -u -d -r1.27 -r1.28
--- Common.py	2 Dec 2002 20:18:08 -0000	1.27
+++ Common.py	3 Dec 2002 00:39:51 -0000	1.28
@@ -165,7 +165,10 @@
     if not _BLKSIZE:
 	#???? this assumes that all filesystems we are using have the same
 	#??? block size.
-	_BLKSIZE = os.statvfs(f)[statvfs.F_BSIZE]
+	if hasattr(os, 'statvfs'):
+	    _BLKSIZE = os.statvfs(f)[statvfs.F_BSIZE]
+	else:
+	    _BLKSIZE = 8192 # ???? Safe guess?
 	_NILSTR = '\x00' * _BLKSIZE
     fd = os.open(f, os.O_WRONLY)
     try: