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

Re: [MacPerl] Mac File 'GetInfo' Size Descrepancies



At 12.09 -0500 1998.05.27, Greg Aiken wrote:
>Last evening I downloaded the most recent version of MacPerl.  The (-d)
>file test
>operator now works fine on my machine.  However, there still appears to be two
>descrepancies that I noticed.  Finder tells me that 'AppleMenuItems:Apple
>System
>Profiler' is an application of size 887K, MacPerl reports it to be of size 0
>bytes.  Finder says that 'AppleMenuItems:VistaScan DA v1.2.2' is an alias
>of size
>65K, MacPerl reports it to be size 0 bytes.  What gives here?

Are you looking at the -s file test for those sizes?  If so, that is where
you have gone wrong.  Apple System Profiler has no data fork, it is all in
the resource fork.  -s only returns data fork size.

ARGH.  In the book it says on p. 270 that -s returns the size of the file
as given in Get Info.  This is not correct.

    use Mac::Files;
    my $cat  = FSpGetCatInfo($file);
    my $size = $cat->ioFlLgLen + $cat->ioFlRLgLen;

--
Chris Nandor          mailto:pudge@pobox.com         http://pudge.net/
%PGPKey = ('B76E72AD', [1024, '0824090B CE73CA10  1FF77F13 8180B6B6'])