[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Reading from process pipes in IDL?
In article <39C9CBD4.D6CC859A@mpipsykl.mpg.de>,
Benno Puetz <puetz@mpipsykl.mpg.de> wrote:
> I have been trying to read image data from compressed (*.gz) files.
>
> While this is possible with
>
> SPAWN, "gunzip "+file+".gz"
>
> OPENR, l, file, /GETLUN
>
> READU, ....
>
> FREE_LUN, l
>
> I would prefer a way similar to PERL's
>
> open(FILE, "gzip -cd $file |");
>
> ...
>
> since it would not have to decompress/compress to disk.
>
> Is this at all possible with IDL?
In V5.3, the /COMPRESS keyword was introduced to OPENR, which allows you
to directly access gzip'ed files in an OS-independent way. I've been
quite happy with this feature -- you can read compressed files almost
completely transparently. One thing to watch out for, is that
although POINT_LUN works on compressed files, it is much slower than on
regular files, since IDL always has to reset to the beginning on each
POINT_LUN call for compresed files.
Wayne Landsman landsman@mpb.gsfc.nasa.gov
Sent via Deja.com http://www.deja.com/
Before you buy.