0

I'm working on some code in IDL that retrieves data files through FTP that are Unix compressed (.Z) files. I know IDL can work with .gz compressed files with the /compress keyword however it doesn't seem capable of playing nicely with the .Z compression.

What are my options for working with these files? The files I am downloading are coming from another institution so I have no control in the compression being used. Downloading and decompressing the files manually before running the code is an absolute last resort as it makes things a lot more difficult as I don't always know which files I need from the FTP site in advance so the code grabs the ones needed based on the parameters in real time.

I'm currently running on Windows 7 but once the code is finished it will be used on a Unix system as well (computer cluster).

  • I think I found a sufficient solution, I can use 'spawn' to decompress the files through a system command before opening them in IDL. – amccaffrey Sep 30 '14 at 22:39

1 Answers1

1

You can use SPAWN as you note in your comment (assuming you can find an equivalent of the Unix uncompress command that runs on Windows), or for higher speed you can use an external C function with CALL_EXTERNAL to do the decompression. Just by coincidence, I posted an answer on stackexchange the other day with just such a C function to decompress .Z files here.

Community
  • 1
  • 1
Mark Adler
  • 101,978
  • 13
  • 118
  • 158