[comp.sources.wanted] Executable compressor

eonu24@castle.ed.ac.uk (I Reid) (05/28/91)

In msdos there is a utility (whose name escapes me at the moment) that allows
you to compress executables (.exe's I mean) into a format that allows them to
be run from their compressed state. As far as i know the compressor adds a
little bit of code to the start of the compressed file to handle the
decompression and running and it is neat and fast. Does such a beast exist for
unix?

Example:

program.exe ----> compprogram.exe (smaller than original)
compprogram.exe - takes slightly longer than its uncompressed rival to start up
                  but after that there is no noticeable difference with most
                  programs

Thanks in advance,

Iain

p.s. Hardware is a Sequent i386 based platform running BSD 4.2 and SysV.

jc@raven.bu.edu (James Cameron) (05/28/91)

>>>>> On 27 May 91 22:39:25 GMT, eonu24@castle.ed.ac.uk (I Reid) said:

[...deleted how to run unix executables while compressed...]

|> program.exe ----> compprogram.exe (smaller than original)
|> compprogram.exe - takes slightly longer than its uncompressed rival to start up
|>                   but after that there is no noticeable difference with most
|>                   programs

|> Iain


	Here's a untested quick hack....It's not pretty, but it does
	what you are asking for.  (* smile *)  Let's see how many more
	prettier ones will be sent after this.  *8-)


#! /bin/csh -f

#
#  compress and execute.  Simple and sweet.  Could be done better
#  but this does it as well as needs be.  (Didn't really need the 
#  `date` part, but just playing it safe.
#

set argc = $#argv

if ( $argc !=  1) then
   echo "Usage:  cx prog"
   exit(1)
endif

set DATE = `date`
set FNAME = "$1$DATE[4]"

cp "$1.Z" "/tmp/$FNAME.Z"

uncompress "/tmp/$FNAME.Z"

"/tmp/$FNAME" 

rm "/tmp/$FNAME"


jc

--
					-- James Cameron  (jc@raven.bu.edu)

Signal Processing and Interpretation Lab.  Boston, Mass  (617) 353-2879
------------------------------------------------------------------------------
"But to risk we must, for the greatest hazard in life is to risk nothing.  For
the man or woman who risks nothing, has nothing, does nothing, is nothing."
	(Quote from the eulogy for the late Christa McAuliffe.)