$dirsize

By ^Neptune on Aug 01, 2008

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
  }
}

Comments

Sign in to comment.
JordanT   -  May 23, 2009

This is better, shame Hawkee hasn't discovered how to change account names yet >:|

 Respond  
a careful warchild   -  May 23, 2009

I swear her said you could view the directories in the different size types, GB, TB, KB & MB.

 Respond  
Jonesy44   -  May 22, 2009

$longip = $remove(str,.)

jordan: use props.

 Respond  
a careful warchild   -  May 22, 2009

Okay, stupid question, but how do I use the different properties?

 Respond  
Lindrian   -  Aug 10, 2008

yes, hepl u validilate ip\'s.. everything in mirc has a great purpose.

 Respond  
^Neptune   -  Aug 10, 2008

..it is? :|

 Respond  
Lindrian   -  Aug 01, 2008

Both $abook and $longip are very usful identifiers, especially $longip :P

 Respond  
^Neptune   -  Aug 01, 2008

Who knows, but there are countless other useless identifiers in mIRC ($abook, $longip), so why not? :)

 Respond  
Lindrian   -  Aug 01, 2008

Not entierly sure what purpose this will fill really. Why would you want the dirsize?

 Respond  
Lord-Harlot   -  Aug 01, 2008

Long description is long

 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.