sec : U Re: Gzip / compression handling? [message #32252] |
Mon, 23 September 2002 16:14 |
Andrew Cool
Messages: 219 Registered: January 1996
|
Senior Member |
|
|
Doug Rowland wrote:
>
> I'm using Mac OS X and Solaris. I'm sure what you describe will work, I
> was just hoping for some way that was OS - independent. (At a minimum, I
> would need to be able to do this under Windows. VMS would be a bonus
> but not completely necessary).
>
> Maybe it will boil down to writing separate modules for each platform,
> using your suggestion for unix and unix-like systems.
>
> Thanks.
>
> Doug
>
>>
>> If you are using a unix system, there might be a way to pipe (|) your
>> lun/stream through the gzip/gunzip command. Are you using unix?
>>
>> -k.
Doug,
Pipe is implemented on VMS too (after a fashion), so if you get
something working under *nix, you might hit the jackpot with VMS too.
Andrew
------------------------------------------------------------ -----------------
Andrew D. Cool
Electromagnetics & Propagation Group
Intelligence, Surveillance & Reconnaissance Division
Defence Science & Technology Organisation
PO Box 1500, Edinburgh
South Australia 5111
Phone : 061 8 8259 5740 Fax : 061 8 8259 6673
Email : andrew.cool@dsto.defence.gov.au
------------------------------------------------------------ -----------------
|
|
|
sec : U Re: Gzip / compression handling? [message #32253 is a reply to message #32252] |
Mon, 23 September 2002 16:09  |
Andrew Cool
Messages: 219 Registered: January 1996
|
Senior Member |
|
|
Doug Rowland wrote:
>
> Does anyone know how to handle compressed files in IDL?
> Is the /COMPRESS keyword platform-independent?
>
> Maybe more importantly, I want to take a data stream over a network that
> is compressed with gzip, and uncompress it in memory. Any easy way of
> doing this? I would like to avoid writing the stream to disk and then
> reading it back in using the /COMPRESS keyword to OPENR, as that might
> introduce lots of overhead.
>
> Thanks.
>
> Doug
Doug,
You might want to look at the GZIP routines provided by Randall Frank
in his IDL_TOOLS routines.
You can find IDL_TOOLS at Ronn Kling's site :- http://www.rlkling.com/
under 'Freeware'.
Andrew
------------------------------------------------------------ -----------------
Andrew D. Cool
Electromagnetics & Propagation Group
Intelligence, Surveillance & Reconnaissance Division
Defence Science & Technology Organisation
PO Box 1500, Edinburgh
South Australia 5111
Phone : 061 8 8259 5740 Fax : 061 8 8259 6673
Email : andrew.cool@dsto.defence.gov.au
------------------------------------------------------------ -----------------
---------------------------------------
Gzip:
err = GZIP('infile','outfile')
Compress the contents of the input file to the output file
in .gz format. The outfile can be read with gunzip.
err = GZIP( var, 'outfile')
Compress the binary contents of the IDL variable VAR to
the output file in .gz format.
err = GUNZIP('infile','outfile')
Uncompress the input (.gz) file to the specified output file.
err = GUNZIP('infile', var [,LENGTH=l[,OFFSET=o])
Uncompress the input (.gz) file into an IDL byte array.
The LENGTH and OFFSET keywords specify the number of bytes
to skip over in the (uncompressed) input stream and the
number of bytes to return in VAR.
err = PACKVAR( invar, outvar)
err = UNPACKVAR( invar, outvar)
These two routines pack an IDL variable into another IDL
variable (byte array) using gzip compression. Note: the
unpack function will reconstruct the original variable
type and there is about a 50 byte overhead for the
compression. So, you won't see any real compression unless
the input variable is more than 100 bytes in length or so.
---------------------------------------
|
|
|