$dirsize

By QuickStep on Aug 20, 2005

Returns directory size

;Usage: $dirsize(C:\directory)
;Returns size in bytes

;Examples:

;/echo -a $dirsize($mircdir)
;Echos out the total size of the mirc directory

;/echo -a $dirsize($mircdir).dir
;If you specify .dir it will not scan deeper within other folders, so it will only return the size of the files located within the mircdir, not included the size of the other directories

alias dirsize {
  var %a, %b
  if ($isdir($$1-)) {
    %b = $findfile($1-,*, [ $+ [ $+(0,$iif($prop,$+($chr(44),0))) ] ] ,inc %a $file($1-).size)
    return %a
  }
}

Comments

Sign in to comment.
KuTsuM   -  Aug 29, 2005

good snippet, very usefull :)

 Respond  
DeathRyder082   -  Aug 21, 2005

Looks good.

 Respond  
DarthReven   -  Aug 21, 2005

Nicely done Quickstep

 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.