OS Module (how to check free space)

Chris Watson chris at voodooland.net
Thu Jan 18 01:27:34 EST 2001


> Hi - newbie question: I've looked over the OS module documentation and I can't find a
> tool within python that will allow me to check how much free space is available on a
> storage device such as a hard drive.
> 
> Does anyone know how to do this?

Kris,

	AFAIK I would use os.spawnv() to call df to get free space
assuming this is on unix. Otherwise call whatever win32 equiv there is.
If you need help with spawnv mail me and ill send you sample code.

--
=============================================================================
-Chris Watson         (316) 326-3862 | FreeBSD Consultant, FreeBSD Geek 
Work:              scanner at jurai.net | Open Systems Inc., Wellington, Kansas
Home:  scanner at deceptively.shady.org | http://open-systems.net
=============================================================================
WINDOWS: "Where do you want to go today?"
LINUX: "Where do you want to go tomorrow?"
BSD: "Are you guys coming or what?"
=============================================================================
GNU = Gnu's Non-portable & Unstable
irc.openprojects.net #FreeBSD -Join the revolution!
ICQ: 20016186





More information about the Python-list mailing list