May 8, 2001, 12:46 PM
Post #2 of 3
It seems that something is broken in the way you get the size of the file in the first place (atleast everything else seems like it would work). The -s modifier will return the size of a file, or you could use the stat(). Here is how I would do it though:
|Of course, I would use sprintf to round because you can specify decimal places to round to, and it is more accurate.
my $size = -s 'my_file.txt';
my $kb_s = int($size / 1024);
Hope that helps!
r j o s e p h
"Violence is a last resort of the incompetent" - Foundation