in reply to Re: Re: get the size of a LARGE file
in thread get the size of a LARGE file
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.
prints@a = stat "a"; print "Real size = $a[7]\n"; print "blocksize * blocknum = ",$a[11]*$a[12],"\n";
and everyone will agree that a file size function which returns 32768 instead of 4 is quite wrong.size = 4 blocksize * blocknum = 32768
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
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Re: Re: get the size of a LARGE file
by dws (Chancellor) on Apr 25, 2002 at 14:59 UTC |