comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: SAVE compress and Gzip
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Re: SAVE compress and Gzip [message #71421] Mon, 21 June 2010 09:50 Go to next message
jeanh is currently offline  jeanh
Messages: 79
Registered: November 2009
Member
On 21/06/2010 12:24 PM, Xavi Llort wrote:
> On 18 jun, 16:23, jeanh
> <jghasb...@DELETETHIS.environmentalmodelers.ANDTHIS.com> wrote:
>> On 18/06/2010 7:33 AM, Xavi Llort wrote:
>>
>>
>>
>>
>>
>>> Hi,
>>
>>> I'm trying to compress save files already done.
>>
>>> If I compress the sav files in the unix terminal with Gzip, then IDL
>>> "RESTORE" command does not recognize them:
>>> IDL> save, a, filename='test.sav'
>>> IDL> exit
>>> $ gzip test.sav
>>> $ idl
>>> IDL> restore, 'test.sav.gz'
>>> % RESTORE: Not a valid save file: test.sav.gz
>>
>>> This trick worked for binary files and OPEN command.
>>
>>> Any ideas how can I manage to compress lots of save files already
>>> done, creating save files which can be directly opened from inside
>>> IDL?
>>
>>> Thanks in advance,
>>> Xavi
>>
>> have you tried
>> save, a, filename='test.sav', /compress
>>
>> Jean
>
> Maybe I did not explain well the problem...
>
> The savs are already done and I would like to compress them
> individually, in a manner that the programs that open them will not
> notice.
> To use the keyword /compress is what I should have done and I
> didn't ;)
>
> Xavi

ah ok,
what about writing a small program that search for all .sav files, then,
in a loop, call a procedure that open the sav files and do a save, /all
/compress with the same (?) filename. (the extra procedure is to make
sure that only the variables of the current sav files are in scope and
saved)

Jean
Re: SAVE compress and Gzip [message #71422 is a reply to message #71421] Mon, 21 June 2010 09:32 Go to previous messageGo to next message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Xavi Llort writes:

> The savs are already done and I would like to compress them
> individually, in a manner that the programs that open them will not
> notice.
> To use the keyword /compress is what I should have done and I
> didn't ;)

Ah! I'm planning a long, 500 mile hike later this summer.
A hike I first did 40 years ago this summer that changed
my life in many ways. I think about this hike (and my life)
a lot these days. This morning on the way to work a song
came on the radio that made me sad. I was thinking about
that on the way back from getting my coffee this morning.
I think I'm sad about roads not taken and now closed off
on any possible way forward.

All this to just say, I feel your pain. :-)

Cheers,

David



--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thue. ("Perhaps thos speakest truth.")
Re: SAVE compress and Gzip [message #71423 is a reply to message #71422] Mon, 21 June 2010 09:24 Go to previous messageGo to next message
Xavi Llort is currently offline  Xavi Llort
Messages: 15
Registered: September 2006
Junior Member
On 18 jun, 16:23, jeanh
<jghasb...@DELETETHIS.environmentalmodelers.ANDTHIS.com> wrote:
> On 18/06/2010 7:33 AM, Xavi Llort wrote:
>
>
>
>
>
>> Hi,
>
>> I'm trying to compress save files already done.
>
>> If I compress the sav files in the unix terminal with Gzip, then IDL
>> "RESTORE" command does not recognize them:
>> IDL>  save, a, filename='test.sav'
>> IDL>  exit
>> $ gzip test.sav
>> $ idl
>> IDL>  restore, 'test.sav.gz'
>> % RESTORE: Not a valid save file: test.sav.gz
>
>> This trick worked for binary files and OPEN command.
>
>> Any ideas how can I manage to compress lots of save files already
>> done, creating save files which can be directly opened from inside
>> IDL?
>
>> Thanks in advance,
>> Xavi
>
> have you tried
> save, a, filename='test.sav', /compress
>
> Jean

Maybe I did not explain well the problem...

The savs are already done and I would like to compress them
individually, in a manner that the programs that open them will not
notice.
To use the keyword /compress is what I should have done and I
didn't ;)

Xavi
Re: SAVE compress and Gzip [message #71455 is a reply to message #71423] Fri, 18 June 2010 07:23 Go to previous messageGo to next message
jeanh is currently offline  jeanh
Messages: 79
Registered: November 2009
Member
On 18/06/2010 7:33 AM, Xavi Llort wrote:
> Hi,
>
> I'm trying to compress save files already done.
>
> If I compress the sav files in the unix terminal with Gzip, then IDL
> "RESTORE" command does not recognize them:
> IDL> save, a, filename='test.sav'
> IDL> exit
> $ gzip test.sav
> $ idl
> IDL> restore, 'test.sav.gz'
> % RESTORE: Not a valid save file: test.sav.gz
>
> This trick worked for binary files and OPEN command.
>
> Any ideas how can I manage to compress lots of save files already
> done, creating save files which can be directly opened from inside
> IDL?
>
> Thanks in advance,
> Xavi

have you tried
save, a, filename='test.sav', /compress

Jean
Re: SAVE compress and Gzip [message #71658 is a reply to message #71421] Tue, 06 July 2010 05:37 Go to previous messageGo to next message
Xavi Llort is currently offline  Xavi Llort
Messages: 15
Registered: September 2006
Junior Member
On 21 jun, 18:50, jeanh
<jghasb...@DELETETHIS.environmentalmodelers.ANDTHIS.com> wrote:
> On 21/06/2010 12:24 PM,XaviLlort wrote:
>
>
>
>
>
>> On 18 jun, 16:23, jeanh
>> <jghasb...@DELETETHIS.environmentalmodelers.ANDTHIS.com>  wrote:
>>> On 18/06/2010 7:33 AM,XaviLlort wrote:
>
>>>> Hi,
>
>>>> I'm trying to compress save files already done.
>
>>>> If I compress the sav files in the unix terminal with Gzip, then IDL
>>>> "RESTORE" command does not recognize them:
>>>> IDL>    save, a, filename='test.sav'
>>>> IDL>    exit
>>>> $ gzip test.sav
>>>> $ idl
>>>> IDL>    restore, 'test.sav.gz'
>>>> % RESTORE: Not a valid save file: test.sav.gz
>
>>>> This trick worked for binary files and OPEN command.
>
>>>> Any ideas how can I manage to compress lots of save files already
>>>> done, creating save files which can be directly opened from inside
>>>> IDL?
>
>>>> Thanks in advance,
>>>> Xavi
>
>>> have you tried
>>> save, a, filename='test.sav', /compress
>
>>> Jean
>
>> Maybe I did not explain well the problem...
>
>> The savs are already done and I would like to compress them
>> individually, in a manner that the programs that open them will not
>> notice.
>> To use the keyword /compress is what I should have done and I
>> didn't ;)
>
>> Xavi
>
> ah ok,
> what about writing a small program that search for all .sav files, then,
> in a loop, call a procedure that open the sav files and do a save, /all
> /compress with the same (?) filename. (the extra procedure is to make
> sure that only the variables of the current sav files are in scope and
> saved)
>
> Jean

This worked, THANKS!

In fact, the files were not mine, but used a lot of disk space! :P

Xavi
Re: SAVE compress and Gzip [message #71701 is a reply to message #71658] Mon, 12 July 2010 13:17 Go to previous message
Aram Panasenco is currently offline  Aram Panasenco
Messages: 41
Registered: April 2010
Member
Xavi Llort wrote:
> On 21 jun, 18:50, jeanh
> <jghasb...@DELETETHIS.environmentalmodelers.ANDTHIS.com> wrote:
>> On 21/06/2010 12:24 PM,XaviLlort wrote:
>>
>>
>>
>>
>>
>>> On 18 jun, 16:23, jeanh
>>> <jghasb...@DELETETHIS.environmentalmodelers.ANDTHIS.com> wrote:
>>>> On 18/06/2010 7:33 AM,XaviLlort wrote:
>>
>>>> > Hi,
>>
>>>> > I'm trying to compress save files already done.
>>
>>>> > If I compress the sav files in the unix terminal with Gzip, then IDL
>>>> > "RESTORE" command does not recognize them:
>>>> > IDL> save, a, filename='test.sav'
>>>> > IDL> exit
>>>> > $ gzip test.sav
>>>> > $ idl
>>>> > IDL> restore, 'test.sav.gz'
>>>> > % RESTORE: Not a valid save file: test.sav.gz
>>
>>>> > This trick worked for binary files and OPEN command.
>>
>>>> > Any ideas how can I manage to compress lots of save files already
>>>> > done, creating save files which can be directly opened from inside
>>>> > IDL?
>>
>>>> > Thanks in advance,
>>>> > Xavi
>>
>>>> have you tried
>>>> save, a, filename='test.sav', /compress
>>
>>>> Jean
>>
>>> Maybe I did not explain well the problem...
>>
>>> The savs are already done and I would like to compress them
>>> individually, in a manner that the programs that open them will not
>>> notice.
>>> To use the keyword /compress is what I should have done and I
>>> didn't ;)
>>
>>> Xavi
>>
>> ah ok,
>> what about writing a small program that search for all .sav files, then,
>> in a loop, call a procedure that open the sav files and do a save, /all
>> /compress with the same (?) filename. (the extra procedure is to make
>> sure that only the variables of the current sav files are in scope and
>> saved)
>>
>> Jean
>
> This worked, THANKS!
>
> In fact, the files were not mine, but used a lot of disk space! :P
>
> Xavi

I might be a little late but I'd just like to say that you can also
compress any files/directories by spawning the tar command. For example,
here's code that compresses a file:

spawn, 'tar czf "'+PathToCompressedFile+'.tar.gz"
"'+PathToFileToBeCompressed+'"
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: diffusion list on GDL
Next Topic: Re: trying to export pixel data from .dat files, based on coordinate loc

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 13:47:07 PDT 2025

Total time taken to generate the page: 0.00618 seconds