Hi,
beside the fact that st_blksize is not the blocksize but only the system preferred bloksize, there is a much more upsetting problem. Multiplying the number of blocks by the size of one block does not give you the size of the file. See the following example, where the file a just contains 4 carcters.
@a = stat "a";
print "Real size = $a[7]\n";
print "blocksize * blocknum = ",$a[11]*$a[12],"\n";
prints
size = 4
blocksize * blocknum = 32768
and everyone will agree that a file size function which returns 32768 instead of 4 is quite wrong.
Of course, one my object that 32768 is the space that the file is taking up on your HD, but this is another story, as Kipling would have said.
Cheers
Leo TheHobbit