
Kanji
User
/ Moderator
Jul 19, 2000, 6:36 AM
Post #3 of 8
(839 views)
|
You don't say what OS you're using but if your account is in a UNIX(ish) enviroment you should be able to use the command 'quota'. If that isn't available, ask the server admin what he/she/they/it recommends, or employ a guestimate method in perl: <BLOCKQUOTE><font size="1" face="Arial,Helvetica,sans serif">code:</font><HR> #!/usr/bin/perl -l use File::Find; my $quota = 1_048_576; # 1MB my $directory = "/path/to/my/directory"; my $tally = 0; find( \&tally, $directory ); sub tally { $tally += -s $File::Find::name } if ( $tally > $quota ) { print "Aiyee! You're ", int( ( $tally - $quota ) / 1024 ), "K over your quota!"; } else { print "You've got ", int( ( $quota - $tally ) / 1024 ), "\K left."; }</pre><HR></BLOCKQUOTE>
|