Dear folks,
after searching the archives and the web for an answer I still can't a
solution to my task.
I need to access the resource fork of some Freehand8 files, namely the
PICT resource 265 and the TEXT resource 265.
These need to be stored in separate files. The PICT resource then needs
to be converted to JPEG (with GD.pm?).
I tried to use Mac::Resources but only got this far:
#!/usr/bin/perl
use warnings;
use strict;
use Mac::Resources;
use Data::Dumper;
my $resfile = '/Users/jwl/Desktop/Isotype/cd_label_jwl.fh';
my $sp = FSpOpenResFile($resfile, 0777);
if ( defined $sp ) {
# get handle for description
my $text = GetResource( 'TEXT', '256');
print Dumper $text;
} else {
# error occurred
die "can't load resource: $!";
}
__END__
This gives me:
$VAR1 = \bless( do{\(my $o = 65688)}, 'Handle' );
so I obviously have a handle to the resource. But how to get the actual
data (should be something like 'here is the description')?
'perldoc Mac::Resources' says:
"GetResource TYPE, ID
Get1Resource TYPE, ID
Get resource data for a resource specified by resource type and
resource ID."
$text should contain the actual text string or am I wrong?
System info:
perl -v
This is perl, v5.8.1-RC3 built for darwin-thread-multi-2level
(with 1 registered patch, see perl -V for more detail)
Mac G5 Dual 1.8 with OS X 10.2.3
any help would be greatly appreciated,
greetings,
Joergen