[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Reading from process pipes in IDL?
Benno Puetz <puetz@mpipsykl.mpg.de> writes:
> 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?
If you are running on a Unix-type operating system, then you can give
my seekable pipes library a try. You can open a gzip'ed or
compress'ed file and they will automatically be unzipped on the fly as
you access them. You can also open any piped stream, not just gzipped
files.
In addition you can seek to anywhere in the (uncompressed) file or
pipe. The only restriction is that you must have enough temporary
disk space to hold the unzipped file.
Here it is, listed under Input/Output:
http://cow.physics.wisc.edu/~craigm/idl/idl.html
Craig
--
--------------------------------------------------------------------------
Craig B. Markwardt, Ph.D. EMAIL: craigmnet@cow.physics.wisc.edu
Astrophysics, IDL, Finance, Derivatives | Remove "net" for better response
--------------------------------------------------------------------------