This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Add 5.14.2-RC1 to perlhist
[perl5.git] / symbian / hexdump.pl
CommitLineData
c7a4d1c0
JH
1#!/usr/bin/perl -w
2
3use strict;
4
5die "$0: EPOCROOT unset\n" unless exists $ENV{EPOCROOT};
6die "$0: EPOCROOT directory does exists\n" unless -d $ENV{EPOCROOT};
7
8my $EPOC32 = "$ENV{EPOCROOT}epoc32";
9my $EXE = "$EPOC32\\release\\thumb\\urel\\perlapp.app";
10my $RSC = "$EPOC32\\data\\z\\system\\apps\\perlapp\\perlapp.rsc";
11
12use Fcntl qw(O_RDONLY);
13
14my %new = ($EXE => 'perlappmin.hex',
15 $RSC => 'perlrscmin.hex');
16
17for my $fn ($EXE, $RSC) {
18 if (sysopen(my $fh, $fn, O_RDONLY)) {
19 my $buffer;
20 my $size = -s $fn;
21 my $read;
22 my $newfn = $new{$fn};
23 unlink($newfn);
24 if (($read = sysread($fh, $buffer, $size)) == $size) {
25 if (open(my $newfh, ">$newfn")) {
26 binmode($newfh);
27 print $newfh unpack("H*", $buffer);
28 close($newfh);
29 print "Created $newfn\n";
30 } else {
31 die qq[$0: open ">$newfn" failed: $!\n];
32 }
33 } else {
34 die qq[$0: sysread $size returned $read\n];
35 }
36 close($fh);
37 } else {
38 die qq[$0: sysopen "$fn": $!\n];
39 }
40}
41