[comp.sys.ibm.pc] uncompress on PC - not there yet

rwh@me.utoronto.ca (Russell Herman) (11/19/89)

In article <2565B872.3324@maccs.dcss.mcmaster.ca> cs4g6ag@maccs.dcss.mcmaster.ca
 (Stephen M. Dunn) writes:
>In article <824@dukempd.phy.duke.edu> fang@dukempd.phy.duke.edu (Fang Zhong) writes:
>$	Are there uudecode and uncompress on PC, which are compitible
>$to the ones on Unix system?
>$	Where can I get them?
>
>   A new version just came across comp.binaries.ibm.pc sometime in the past
>week or two.

Yes, but it's still not 100% compatible.  I found a file that had been
compressed elseware (don't know on what) which was accused of corruption
by the recently posted compress 4.0.  I uploaded it to a SUN and it
decompressed without any problems.  A careful reading of the comments
supplied with the posted version brought me to conclude that a UNIX
uncompress will handle files compressed by 4.0, but not necessarily
the converse.

So the need still exists...

Russ Herman
INTERNET: rwh@me.utoronto.ca  UUCP: ..uunet!utai!me!rwh

ddl@husc6.harvard.edu (Dan Lanciani) (11/20/89)

In article <89Nov19.101032est.18571@me.utoronto.ca>, rwh@me.utoronto.ca (Russell Herman) writes:
| In article <2565B872.3324@maccs.dcss.mcmaster.ca> cs4g6ag@maccs.dcss.mcmaster.ca
|  (Stephen M. Dunn) writes:
| >In article <824@dukempd.phy.duke.edu> fang@dukempd.phy.duke.edu (Fang Zhong) writes:
| >$	Are there uudecode and uncompress on PC, which are compitible
| >$to the ones on Unix system?
| >$	Where can I get them?
| >
| >   A new version just came across comp.binaries.ibm.pc sometime in the past
| >week or two.
| 
| Yes, but it's still not 100% compatible.  I found a file that had been
| compressed elseware (don't know on what) which was accused of corruption
| by the recently posted compress 4.0.  I uploaded it to a SUN and it
| decompressed without any problems.

	Could I get a sample of such a file?  Alternately, could you
try it with the compress.exe available from husc6.harvard.edu in
pub/pcip?  I believe this version to be fully compatible.

				Dan Lanciani
				ddl@harvard.*

chasm@attctc.Dallas.TX.US (Charles Marslett) (11/21/89)

In article <89Nov19.101032est.18571@me.utoronto.ca>, rwh@me.utoronto.ca (Russell Herman) writes:
:: In article <2565B872.3324@maccs.dcss.mcmaster.ca> cs4g6ag@maccs.dcss.mcmaster.ca
::  (Stephen M. Dunn) writes:
:: >In article <824@dukempd.phy.duke.edu> fang@dukempd.phy.duke.edu (Fang Zhong) writes:
:: >$	Are there uudecode and uncompress on PC, which are compitible
:: >$to the ones on Unix system?
:: >$	Where can I get them?
:: >
:: >   A new version just came across comp.binaries.ibm.pc sometime in the past
:: >week or two.
:: 
:: Yes, but it's still not 100% compatible.  I found a file that had been
:: compressed elseware (don't know on what) which was accused of corruption
:: by the recently posted compress 4.0.  I uploaded it to a SUN and it
:: decompressed without any problems.  A careful reading of the comments
:: supplied with the posted version brought me to conclude that a UNIX
:: uncompress will handle files compressed by 4.0, but not necessarily
:: the converse.

I have been using compress 4.3 on both a Unix system (interactive 386/ix)
and MSDOS and have had no problems with any conpressed files -- the code
is even there for the special handling MSDOS requires so stdin and stdout
can be compressed (binary) files.

:: Russ Herman
:: INTERNET: rwh@me.utoronto.ca  UUCP: ..uunet!utai!me!rwh


Charles
===============================================================================
"Those who would sacrifice **  Charles Marslett
liberty for security,      **  STB Systems, Inc. <-- apply all std. disclaimers
deserve neither."          **  Wordmark Systems  <-- that's just me
  -- Benjamin Franklin     **  chasm\@attctc.dallas.tx.us
-------------------------------------------------------------------------------

klink@sce.carleton.ca (Robert Klinkhammer) (11/22/89)

I'm posting this for ...!uunet!mitel!sce!tsmith!graham (Doug Graham)
who has only clandestine net access. :-)

In article <89Nov19.101032est.18571@me.utoronto.ca>, rwh@me.utoronto.ca (Russell Herman) writes:
> In article <2565B872.3324@maccs.dcss.mcmaster.ca> cs4g6ag@maccs.dcss.mcmaster.ca
>  (Stephen M. Dunn) writes:
> >In article <824@dukempd.phy.duke.edu> fang@dukempd.phy.duke.edu (Fang Zhong) writes:
> >$	Are there uudecode and uncompress on PC, which are compitible
> >$to the ones on Unix system?
> >   A new version just came across comp.binaries.ibm.pc sometime in the past
> >week or two.

I'm assuming that the compress referred to below, is the one that I posted
to comp.sources.misc about a week ago. I don't remember seeing one in
c.b.ibm.pc. If I'm wrong, please excuse the waste of network bandwidth.

> Yes, but it's still not 100% compatible.  I found a file that had been
> compressed elseware (don't know on what) which was accused of corruption
> by the recently posted compress 4.0.  I uploaded it to a SUN and it
> decompressed without any problems.  A careful reading of the comments
> supplied with the posted version brought me to conclude that a UNIX
> uncompress will handle files compressed by 4.0, but not necessarily
> the converse.

The converse is also true. That was the main point of the excercise.
It is possible though, that I was a bit over-zealous in adding error
checking. The original compress 4.0 depended on getting a SIGSEGV
if it was given a corrupt input file. This doesn't work on an 8088.
(And not very well on anything else for that matter). I added a bit
of code to try to avoid a system crash in the event of a bad input file.
I may have screwed up. I'll go have a closer look. See ya in comp.sources.bugs.
I would appreciate it, if you could send me a copy of the compressed
file that caused the trouble. (That is, if it's not too big)

If this really is the problem, removing the lines:

	if (code != freecode + 1)
		oops();

from the function decompress() will cure it, although you will then
have no protection against a bad input file.

Doug.
-- 
**********************************************************************
Robert Klinkhammer          "They recommended euthanasia 
<klink@sce.carleton.ca>     for noncomformists anywhere" -- Asia
**********************************************************************

klink@sce.carleton.ca (Robert Klinkhammer) (11/22/89)

Once again, posted for ...!uunet!mitel!sce!tsmith!graham

After rereading the paper by Welch, and staring at the code for another
couple of hours, I'm a bit more confident that the code is correct. I can
think of at least 4 reasons that compress would complain about corrupt input:

1) The file really was corrupt. Did you look at the output generated by
   decompress on the SUN? It is possible that it would quietly decompress
   corrupt input. (Unless SUN have made enhancements)

2) The file got nuked while copying it to your PC. Did you use a binary
   file transfer mechanism. Was the size of the file the same on the PC
   as on the SUN?

3) The compiler that you used to compile compress is broken. Or it somehow
   managed to open the input file in text mode rather than binary mode.

4) I'm broken.

> I would appreciate it, if you could send me a copy of the compressed
> file that caused the trouble. (That is, if it's not too big)

This is still holds, as I am quite concerned about point 4, and am
anxious to disprove it.

Doug.

-- 
**********************************************************************
Robert Klinkhammer          "They recommended euthanasia 
<klink@sce.carleton.ca>     for noncomformists anywhere" -- Asia
**********************************************************************