Two things that make me wonder:
- why do you check for $istok(removable), and then do an "&& (!= removable)" ?
- why do set $bytes().suf in variables, instead of the pure bytes integer? You can $calc your percentages with the %stored_integers, and return the sizes with $bytes(%stored_integers).suf
Code:
alias diskz {
  var %total = 0, %free = 0, %i = 1
  while ($disk(%i).type) {
    if ($istok(fixed remote,$v1,32)) {
      inc %total $disk(%i).size
      inc %free $disk(%i).free
    }
    inc %i
  }
  echo -a -> Total: $bytes(%total).suf - Free: $bytes(%free).suf -> $+($chr(40),$round($calc(%free / %total * 100),2),$chr(37),$chr(41)) 
}


Last edited by Horstl; 24/04/09 09:46 PM.