This alias returns the size of the specified directory and any specified subdirectories. Put this in your aliases section. Here's my "help file entry" on this:
$dirsize(dir,depth)
Returns the size of the specified directory and any specified subdirectories.
$dirsize supports these properties:
bytes ---- returns size in bytes
kilo ---- returns size in kilobytes
mega ---- returns size in megabytes
giga ---- returns size in gigabytes
tera ---- returns size in terabytes
If no property is given, $dirsize returns the size in bytes.
To search JUST the specified directory and no subdirectories, you can specify depth as 1. To search the specified directory and ALL subdirectories, specify depth as 0.
I think this alias could be useful in some places, but I dunno, use your imagination. :P. Honestly, do NOT search a gigantic directory with 0 as depth (like C:), otherwise it will just freeze your mIRC (use CTRL+ALT+PauseBreak to get out of it).
I had the original idea for this, but the alias kept going wrong. I had it using $findfile and writing the results to a .txt file, then using a while loop to increase a variable by the amount of each line in the .txt file. Then it removed the file. Sound complicated? You bet. Then Daveoh helped me make a much simpler script. Then I incorporated $properties into it. Then Daveoh said it was long and could be shortened again, and he came up with what's below. And that's the.. uh.. 'history' of this alias. lol
This is my first custom identifier that uses brackets and properties.
dirsize {
if ($isid) {
var %i
noop $findfile($$1,*,$2,inc %i $file($1-).size)
return $bytes(%i,$iif($prop,$left($v1,1),b)).suf
}
}