Re: FILE_GZIP removes file extension [message #84865 is a reply to message #84862] |
Fri, 14 June 2013 13:09   |
chris_torrence@NOSPAM
Messages: 528 Registered: March 2007
|
Senior Member |
|
|
On Friday, June 14, 2013 1:24:12 PM UTC-6, Mark Piper wrote:
> On Thursday, June 13, 2013 5:18:31 PM UTC-6, timoth...@gmail.com wrote:
>
>>
>
>> However it seems to me that it would be good to have an option to save the original name. In fact you would think that would be the default to save the original to be consistent with how the file_zip routine works and have the option to not save the original name.
>
>>
>
>
>
> Hi Tim,
>
>
>
> Though odd, this is expected behavior for GZIP. Chris, his team and I actually discussed this when they were creating FILE_GZIP/FILE_GUNZIP.
>
>
>
> Note that the default one-parameter call to these routines preserves the original extension; e.g.,
>
>
>
> IDL> file_gzip, 'foo.txt'
>
> IDL> $ls
>
> foo.txt foo.txt.gz
>
>
>
> with complimentary behavior for FILE_GUNZIP.
>
>
>
> mp
Just to chime in, Mark's explanation is correct. By default, you shouldn't need to use the second argument. It's just like on Unix, when you do "gzip file", you don't normally supply the output filename. The second argument is really only there if you need to write the file to a different directory, or if you *insist* on giving the gzip file a new name (which will then carry over to the uncompressed file name).
But just to be safe, I'll add a note to the documentation explaining this behavior.
Cheers,
Chris
ExelisVIS
|
|
|