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

Home » Public Forums » archive » Requested change to "SAVE" procedure
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
Requested change to "SAVE" procedure [message #82870] Tue, 22 January 2013 07:50 Go to next message
lefsky@gmail.com is currently offline  lefsky@gmail.com
Messages: 13
Registered: June 2010
Junior Member
I've been wanting this for a while:

Sometimes I type save and (for a variety of reasons)overwrite an old idslave file that I didn't want to overwrite. What I'd like to see is the default behavior include a query to the user if a) no filename is provided (i.e. the idlsave.dat file is going to be used) and b) the command is issued from the command line. This should prevent accidental over-writes but not impact program behavior.

What would be the negative implications of such a change? Are others interested in this modification?

Exelisvis: Is this possible?
Re: Requested change to "SAVE" procedure [message #82920 is a reply to message #82870] Thu, 24 January 2013 08:08 Go to previous message
Paul Van Delst[1] is currently offline  Paul Van Delst[1]
Messages: 1157
Registered: April 2002
Senior Member
Hello,

On 01/23/13 12:33, Matthew wrote:
>> If "accidental" overwrites are that big of an issues for you, how
>> come you are not checking that the file exists before you try to
>> create it -- and thus clobber existing ones?
>
> The SAVE command works without any arguments. If SAVE is called
> without arguments, I would assume that the user wants a new file, not
> to overwrite existing files. In this case, a '-001' appended to the
> filename seems like the right move. Either that, or make FILENAME
> required.

Huh. My assumption would be that, if called without any argument, then
the user isn't concerned with details like "does the file exist?". They
just want to SAVE the variables. By not specifying the path+filename
explicitly, the user is effectively telling IDL that where and into
which file variables get saved is not an issue.

If that is not the case (say, late at night :o) then the user should be
explicit about the filename.

I'm also not a big fan of stuff like appending "version numbers" onto
files. It seems an unnecessary complication and (based purely on my
personal experience) once the next morning arrives those version numbers
are meaningless (I have a pretty crappy memory I guess :o)

> If SAVE is called with the FILENAME keyword, then clobbering should
> take place. It is definitely the user's fault this time.

If it's the same (default) filename, then yes.

> My two cents...

I guess in the end it comes down to what people think is a reasonable
default behaviour. My programming education started with Fortran so the
IDL behaviour in this case makes perfect sense.

Maybe the SAVE procedure should be changed to make the filename argument
mandatory? That sounds like a reasonable compromise (at the expense of
breaking older codes).

cheers,

paulv
Re: Requested change to "SAVE" procedure [message #82937 is a reply to message #82870] Wed, 23 January 2013 08:39 Go to previous message
Mark Piper is currently offline  Mark Piper
Messages: 198
Registered: December 2009
Senior Member
On Tuesday, January 22, 2013 8:50:43 AM UTC-7, lef...@gmail.com wrote:
>
> Exelisvis: Is this possible?

I'm scoping some updates to SAVE in IDL 8.3, so I'll monitor this thread as people continue to weigh in.

mp
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: Coyote Graphics Plot Gallery Now Open
Next Topic: FFT phase?

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

Current Time: Wed Oct 08 13:35:46 PDT 2025

Total time taken to generate the page: 0.00398 seconds