in reply to Re: How to concatenate binary files
in thread How to concatenate binary files

I've never done this kind of thing, so this is a completely ignorant question: why don't you do the whole thing with a single call to zip -A, like this:

my $sfx = File::Spec->catfile(LocationOfUnzipsfxExe(), 'unzipsfx.exe') +; system( qw( zip -A ), $exe, $sfx, $zip ) and die "$?"; unlink $zip;

the lowliest monk

Replies are listed 'Best First'.
Re^3: How to concatenate binary files
by Tanktalus (Canon) on Apr 12, 2005 at 23:45 UTC

    That's a very good and interesting question. I suppose the reason why I did it the way above is because it's a perl interpretation of the unzipsfx docs (check the man page on unzipsfx - the EXAMPLES section near the bottom).

    A quick test shows:

    $ zip -A mysfx /usr/bin/unzipsfx x adding: usr/bin/unzipsfx (deflated 52%) adding: x (deflated 12%) $ file mysfx mysfx: Zip archive data, at least v2.0 to extract
    which is far from what we want. The output is still a zip file. But, if we do the shell version of the perl code above, we get:
    $ cat /usr/bin/unzipsfx mysfx > mysfx_exe $ zip -A mysfx_exe mysfx_exe: adjusting offsets for a preamble of 47552 bytes $ file mysfx_exe mysfx_exe: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), f +or GNU/Linux 2.2.5, dynamically linked (uses shared libs), stripped
    I hope that helps.