checking free disk space

Oldayz sill at localhost.kitenet.net
Tue Jan 16 20:55:42 EST 2001


On Mon, 15 Jan 2001 14:23:59 +0200, Langa Kentane <LangaK at discoveryhealth.co.za> wrote:
>Good day.
>
>I want to write a script that I can use to check the free disk space on all
>drives.  The script will be used in Linux and Wind0ze.
>
>For instance, I want to write something like:
>
>get list of mounts/drives
>for i in mount_list
>	check disk space left in %
>	if disk space is certain amout:
>		do this
>	else
>		do that
>	endif
>endrun
>
>Please can you point me in the right direction.  I posted something before
>on this list but I realised that will not work in a wind0ze environment.

On unix you can parse output of df, and on windows I'm not entirely sure
but doesn't dir command tell you how much space is left on drive? So you
can keep trying cd X:; dir; starting with C and until you run out of drives..
You can tell if it's a cd if it's under 650mb and has no free space at all.

>
>Thanks in advance.
>
>__________________________________________________________
>Langa Kentane		| TEL: (011) 290 3218
>Security Administrator	| Cell: 082 606 1515
>DISCOVERY HEALTH		| http://www.discoveryhealth.co.za
>__________________________________________________________________
>
>


-- 

	Andrei



More information about the Python-list mailing list