Simple diskinfo

By knoeki on Mar 26, 2009

Very simple little script. checks and shows the channel your total, used, and free diskspace.

Someone might like it.

UPDATE:

Added a little bonus oneliner, just copy/paste it into your inputbox ;_)

alias diskinfo {
   var %x 1
   while (%x <= $disk(0)) {
      var %totalspace $calc(%totalspace + $disk(%x).size)
      var %totalfree $calc(%totalfree + $disk(%x).free)
      inc %x
   }
   say 10Total disks: $+(11,%x,10;) Total diskspace: $+(11,$bytes(%totalspace, g).suf,10;) Total Free Space: $+(11,$bytes(%totalfree, g).suf,10;) Used: $+(11,$bytes($calc(%totalspace - %totalfree), g).suf,10.)
}

/* below is a oneliner version, will also show disklabels when available. This one shows each individual disk. */

//var %x 1 | while (%x <= $disk(0)) { say $disk(%x).path $+($chr(91),$disk(%x).label,$chr(93),:) $+($bytes($calc($disk(%x).size - $disk(%x).free),g).suf,/,$bytes($disk(%x).size),g).suf) | inc %x }

Comments

Sign in to comment.
knoeki   -  Mar 27, 2009

this is for mSl? i want aware it had local variables... :l

and now you are ;_)

use them wisely ;_)

 Respond  
EMMURE   -  Mar 27, 2009

this is for mSl? i want aware it had local variables... :l

 Respond  
Aucun50   -  Mar 26, 2009

Nice

 Respond  
Kirby   -  Mar 26, 2009

Very nice, simple while script. :-)

 Respond  
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.