Re: How to Zip cross-platform from IDL? [message #83971 is a reply to message #83328] |
Tue, 16 April 2013 01:15  |
Lajos Foldy
Messages: 176 Registered: December 2011
|
Senior Member |
|
|
Hi Chris,
On Tuesday, April 16, 2013 6:50:04 AM UTC+2, Chris Torrence wrote:
> Hi all,
>
>
>
> **Spoiler alert**
>
>
>
> Here's what we've got for IDL 8.2.3:
>
>
>
> FILE_TAR: Input files or directories, output to a tar file or to a memory buffer. Optional GZIP compression. Optional keyword to just get a list of files but don't do any real work.
>
>
>
> FILE_UNTAR: Input a tar file or a memory buffer, output all the files/directories. Automatically handles GZIP compression. Optional keyword to just get a list of files but don't do any real work.
>
>
>
> FILE_ZIP: Input files or directories, output to a zip file. Optional keyword to just get a list of files but don't do any real work.
>
>
>
> FILE_UNZIP: Input a zip file, output all the files/directories. Optional keyword to just get a list of files but don't do any real work.
>
>
>
> FILE_GZIP: Input file or files, output each to either gzip file or to a memory buffer.
>
>
>
> FILE_GUNZIP: Input gzip file or files, output the uncompressed files or to a memory buffer.
>
>
>
> ZLIB_COMPRESS: Input an array of any IDL numeric type, output an array with Deflate compression (with either no header, a ZLIB header, or a GZIP header).
>
>
>
> ZLIB_UNCOMPRESS: Input a byte array with compressed data, output an IDL numeric type (given the appropriate type and dimensions).
>
>
>
> Note that for all of the FILE* routines, the assumption is that you have files at one end or the other (or both) - you cannot go straight from data to a compressed memory buffer, and then go back to uncompressed data. Instead, if you want to do that, you can just use the raw ZLIB_COMPRESS/UNCOMPRESS routines.
>
>
>
> Regarding speed tests, I can TAR and UNTAR about 2000 small files in ~10 seconds on pokey Windows NTFS. On Linux it take 0.45 seconds.
>
>
>
> Using ZLIB_COMPRESS/UNCOMPRESS, it takes about 3 seconds to compress/uncompress ~100 MB of data.
>
>
>
> Cheers,
>
> Chris
>
> ExelisVIS
May I suggest to add LZO, bzip2 and xz as an option? With these, one would be able to choose a good trade-off between speed and compression ratio, eg. LZO (fastest) for developing code and xz (best compression ratio) for release mode.
regards,
Lajos
|
|
|