Subject: | Mac::Resources has endian problems on intel systems |
$ perl -v
This is perl, v5.8.8 built for darwin-2level
Mac::Resources, from Mac::Carbon 0.74, builds ok on intel (10.4.6), and 'make test' says ok,
but attempting to read any resource fork produces garbage. I'm guessing that this is because
the byte-order of the resource fork is swapped with respect to the intel CPU's natural byte-
order.
Simple test case:
$ perl -Mstrict -we '
use Mac::Resources; my $r = FSOpenResourceFile("encore.sd2", "rsrc", 0) or die
$!; my $c = CountTypes(); my $t; for (1 .. $c) { $t = GetIndType($_); print "$_
: $t\n"; }'
1: RTS
2: LMds
3: LLds
4: LRdd
5: WEVo
6: LTNC
7: TRLA
8: xrla
9: LTID
...etc
This file actually has only four resource types. One is 'STR ', which we can see in byte-
swapped form on line 1 of the output.