[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [MacPerl] -s File Test Operator



On Tue, 21 Jul 1998, Jeff at MacTech wrote:

>On the other hand, if -s is supposed to return the size of a file, it
>doesn't do that.

And reading a file using <HANDLE> can't read the entire file either. It
can only read the data fork. You can print only print to the data fork,
too.

As far as compatibility of the Mac with other OS's is concerned, the
data fork IS the file.

The resource fork is an entirely different beast: it is a TREE, not a
flat file.

The only reason I can think of, for -s to return the combined sizes of
both forks, is to let you estimate how much room you need to copy a
file. But that doesn't work: a file always takes more space than it's
file size would suggest. Files always use a whole number of disk
sectors. You have to round upwards. The disk sector size is disk
dependent.

And on the Mac, you have to round the sizes of the data fork and of the
resource fork up, separately, before adding up these results.

In short: I can see no reason whatsoever for the Mac to simply add the
number of bytes of both forks. The result would be useless.

At least, the value that -s currently returns IS useful.

=09Bart.

***** Want to unsubscribe from this list?
***** Send mail with body "unsubscribe" to mac-perl-request@iis.ee.ethz.ch