diff options
author | Jarkko Hietaniemi <jhi@iki.fi> | 2005-10-26 18:50:08 +0300 |
---|---|---|
committer | H.Merijn Brand <h.m.brand@xs4all.nl> | 2005-10-26 12:37:47 +0000 |
commit | c7a4d1c0391ba3d9736e90c66ae273d85847f9b0 (patch) | |
tree | 041acf92013ca87779ddc321763721535e45ad58 /symbian/hexdump.pl | |
parent | 65ff66fc0a6ee149618151ba533f4aac04969309 (diff) | |
download | perl-c7a4d1c0391ba3d9736e90c66ae273d85847f9b0.tar.gz |
Symbian: better Series 80 support
Message-ID: <B356D8F434D20B40A8CEDAEC305A1F24E7A6AA@esebe105.NOE.Nokia.com>
p4raw-id: //depot/perl@25856
Diffstat (limited to 'symbian/hexdump.pl')
-rw-r--r-- | symbian/hexdump.pl | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/symbian/hexdump.pl b/symbian/hexdump.pl new file mode 100644 index 0000000000..37adff3577 --- /dev/null +++ b/symbian/hexdump.pl @@ -0,0 +1,41 @@ +#!/usr/bin/perl -w + +use strict; + +die "$0: EPOCROOT unset\n" unless exists $ENV{EPOCROOT}; +die "$0: EPOCROOT directory does exists\n" unless -d $ENV{EPOCROOT}; + +my $EPOC32 = "$ENV{EPOCROOT}epoc32"; +my $EXE = "$EPOC32\\release\\thumb\\urel\\perlapp.app"; +my $RSC = "$EPOC32\\data\\z\\system\\apps\\perlapp\\perlapp.rsc"; + +use Fcntl qw(O_RDONLY); + +my %new = ($EXE => 'perlappmin.hex', + $RSC => 'perlrscmin.hex'); + +for my $fn ($EXE, $RSC) { + if (sysopen(my $fh, $fn, O_RDONLY)) { + my $buffer; + my $size = -s $fn; + my $read; + my $newfn = $new{$fn}; + unlink($newfn); + if (($read = sysread($fh, $buffer, $size)) == $size) { + if (open(my $newfh, ">$newfn")) { + binmode($newfh); + print $newfh unpack("H*", $buffer); + close($newfh); + print "Created $newfn\n"; + } else { + die qq[$0: open ">$newfn" failed: $!\n]; + } + } else { + die qq[$0: sysread $size returned $read\n]; + } + close($fh); + } else { + die qq[$0: sysopen "$fn": $!\n]; + } +} + |