Saving layout files #HowTo #Bug


Dave Bullis
 

The default for the next release is to disable autosave.
If you're new to v5.2.2 and want this behavior you can set it on the Preferences dialog
If you've been running v5.2.2b1 then the option had been set to 2 and you may want to reset it to 0.

Dave


Robert Scott
 

That's the work-around. With Autosave off, all the saved files stay in place and files you don't want don't get saved.
Save the file, make multiple changes, don't like the result, go back to saved file.
If you like the result, save it, under a new name or not.

Bob

On Sunday, March 7, 2021, 10:37:46 a.m. EST, Nick <nick.meredith@...> wrote:


Oddly, I've never had this problem - but then the first thing I've always done when starting a new variant of a layout under a new name is to save it under that new name in case of crashes. 

On Sun, 7 Mar 2021, 14:22 Robert Scott via groups.io, <sparky1bob=yahoo.ca@groups.io> wrote:
I am with Rob as well.
Running 5.2.1a on Windows 10, wondering no more.
Now I know what happened to all those layouts.

Typically, I would create a space, such as a two car garage, and give the space a name, such as "DBL GARAGE."
Each different table design and each different layout on that table would get a number, so "DBL GARAGE 22" would be the second table design, second layout. A variation on that layout might be "DBL GARAGE 221".

Not knowing Autosave was working in the background caused layouts, that I wanted to save, to vanish. Same name on a different layout, original gone, poof, cloud of smoke, echo of maniacal laughter. That would result in an appeal to Whisky, Tango, Foxtrot and the gods of software. I suspected Norton was at work again, so I didn't create a #BUG.

Bob
On Sunday, March 7, 2021, 07:33:12 a.m. EST, Chris Kenyon <chriskenyon@...> wrote:


I am 100% with @Rob Pearce - I haven't moved on to 5.2 but Autosave would definitely have caught me out unless the default frequency was zero.  I regularly open a file and fiddle around with it, for ages sometimes, to see if something works.  If it does, I either "save" or "save as" depending on whether I want to keep both the original version and the new one, or just the new one. But if the idea doesn't work, I just exit without saving.  If an autosave had in the meantime overwritten the original file, meaning I couldn't get back to it "as was", I would be most dischuffed.

Cheers, Chris


Nick
 

Oddly, I've never had this problem - but then the first thing I've always done when starting a new variant of a layout under a new name is to save it under that new name in case of crashes. 


On Sun, 7 Mar 2021, 14:22 Robert Scott via groups.io, <sparky1bob=yahoo.ca@groups.io> wrote:
I am with Rob as well.
Running 5.2.1a on Windows 10, wondering no more.
Now I know what happened to all those layouts.

Typically, I would create a space, such as a two car garage, and give the space a name, such as "DBL GARAGE."
Each different table design and each different layout on that table would get a number, so "DBL GARAGE 22" would be the second table design, second layout. A variation on that layout might be "DBL GARAGE 221".

Not knowing Autosave was working in the background caused layouts, that I wanted to save, to vanish. Same name on a different layout, original gone, poof, cloud of smoke, echo of maniacal laughter. That would result in an appeal to Whisky, Tango, Foxtrot and the gods of software. I suspected Norton was at work again, so I didn't create a #BUG.

Bob
On Sunday, March 7, 2021, 07:33:12 a.m. EST, Chris Kenyon <chriskenyon@...> wrote:


I am 100% with @Rob Pearce - I haven't moved on to 5.2 but Autosave would definitely have caught me out unless the default frequency was zero.  I regularly open a file and fiddle around with it, for ages sometimes, to see if something works.  If it does, I either "save" or "save as" depending on whether I want to keep both the original version and the new one, or just the new one. But if the idea doesn't work, I just exit without saving.  If an autosave had in the meantime overwritten the original file, meaning I couldn't get back to it "as was", I would be most dischuffed.

Cheers, Chris


Robert Scott
 

I am with Rob as well.
Running 5.2.1a on Windows 10, wondering no more.
Now I know what happened to all those layouts.

Typically, I would create a space, such as a two car garage, and give the space a name, such as "DBL GARAGE."
Each different table design and each different layout on that table would get a number, so "DBL GARAGE 22" would be the second table design, second layout. A variation on that layout might be "DBL GARAGE 221".

Not knowing Autosave was working in the background caused layouts, that I wanted to save, to vanish. Same name on a different layout, original gone, poof, cloud of smoke, echo of maniacal laughter. That would result in an appeal to Whisky, Tango, Foxtrot and the gods of software. I suspected Norton was at work again, so I didn't create a #BUG.

Bob

On Sunday, March 7, 2021, 07:33:12 a.m. EST, Chris Kenyon <chriskenyon@...> wrote:


I am 100% with @Rob Pearce - I haven't moved on to 5.2 but Autosave would definitely have caught me out unless the default frequency was zero.  I regularly open a file and fiddle around with it, for ages sometimes, to see if something works.  If it does, I either "save" or "save as" depending on whether I want to keep both the original version and the new one, or just the new one. But if the idea doesn't work, I just exit without saving.  If an autosave had in the meantime overwritten the original file, meaning I couldn't get back to it "as was", I would be most dischuffed.

Cheers, Chris


Chris Kenyon
 

I am 100% with @Rob Pearce - I haven't moved on to 5.2 but Autosave would definitely have caught me out unless the default frequency was zero.  I regularly open a file and fiddle around with it, for ages sometimes, to see if something works.  If it does, I either "save" or "save as" depending on whether I want to keep both the original version and the new one, or just the new one. But if the idea doesn't work, I just exit without saving.  If an autosave had in the meantime overwritten the original file, meaning I couldn't get back to it "as was", I would be most dischuffed.

Cheers, Chris


Rob Pearce
 

On 07/03/2021 02:13, Adam Richards wrote:
1. Not auto-saving - that's already a feature - simply set the auto-save frequency to zero.
When I did that, it produced an "Invalid number" tag, although it let me click OK and seems to have accepted it.


Adam Richards
 

Well there seem to be two aspects -

1. Not auto-saving - that's already a feature - simply set the auto-save frequency to zero. 
2. Not setting the layout name to the Save As... value but saving the file as that name only. Firstly the behaviour of Save As is of long-standing and is in common with many consumer products (Word, etc) that nearly all new users will be familiar with. It may be thought to be beneath contempt by some, but clearly a lot of folks are pre-conditioned to expect this method (including many of our long-time users). Breaking that behaviour therefore would be bad for folks that rely on it as it would do the opposite. So therefore we either need a new verb (e.g., Save Version ... ) or a setting on Save As ...  that says, "don't change layout name".  I actually think the former approach is superior as it is much more obvious and less "fiddly".

Adam 


emrldsky
 

On 3/6/2021 1:10 PM, Rob Pearce wrote:
On 06/03/2021 15:47, scenicsRme via groups.io wrote:
Adam, Count me as one who would like "save as..." to work like many other programs

Me too!
I also.

Peace,
Mike G.


Rob Pearce
 

On 06/03/2021 15:47, scenicsRme via groups.io wrote:
Adam, Count me as one who would like "save as..." to work like many other programs
Me too!

If I've made some changes to the layout, experimentally, then decide I'm not sure about them, so I do "save as" to a different name, then I expect the original file NOT TO HAVE CHANGED. I haven't saved it under that name.

Certainly keep the rolling checkpoint stuff - being able to recover from a crash is definitely good - but don't EVER save to the real file unless the user tells you to. Silent autosave (of the real file) is evil, and always was evil even when Microsoft implemented it in the 1990s to get round the astonishing frequency of their crashes. That's why they changed it to a recovery file system on later versions. (Of course with the advent of "the cloud" they've now decided to adopt a continuous save, no you don't get a choice, no you can't do anything that isn't permanent, no no no you cannot work like a human being... approach. I don't want to see that adopted!)


scenicsRme
 

Adam, Count me as one who would like "save as..." to work like many other programs where it asks you what name and where you want it saved to, then makes a copy to the named directory not to the current work directory, and it does not overwrite the name of the current layout or change it in any other way. I often want to do "what if" changes to my layout in the save as... file without changing the original file so I can compare the two versions. I really dislike the way it works presently as I have to save the file to be sure to include the most recent changes, go into my file manager|working directory find the current file and make a copy to a different directory, rename that copy i.e. my layout.test revision1 and then open that copy. A tedious workaround exercise fraught with possible errors at best.


Adam Richards
 

Hi Mike, 
Let's walk the scenario out and see what can happen - and also work out if we have a bug. <shock!, horror!>

Seriously - there has been a bug recently found and fixed in this area - fix #3788 - where when you Save As or Open a new layout filename the current checkpoint was not wiped out, so that if you don't make enough changes to trigger another checkpoint but quit/fail AND when you restart you ask for the checkpoint to be used, the layout will have the new name BUT the contents will be the old layout file. A quick Save at that point, and the "new" layout file is toast, overwritten by the old file checkpoint!!!  No Bueno!

- How is it supposed to work? 

At any one time XTrackCAD is working with one filename.  When you Save As... you are writing out a new file with all the changes up to current with a different name and you are changing the current filename it is using.  Open also changes the name. So that's item 1. Save As is abandoning the old current (whatever state it was) and making a new file current.

Now if you had Saved the current layout just before at that point - both the current layout file and the Save As... layout file will be identical.  And that could happen in a couple of ways -

  1. You could have just Saved and immediately Exit the program - when you exit, you'll get asked if you want to save including all current changes but if there are none, or you say no.... two identical files.  This is the scenario in the area of the bug, of course, because on restart the checkpoint from the old file is lurking ready to pounce.
  2. New changes do not make it into the current layout file immediately - every so many changes they pile up in the checkpoint files and will be available when you restart the program, but if you do enough of them (i.e., take enough checkpoints), Auto-Save (assuming it is set on) will update the current file for you.  So, it could be that you had exactly enough changes to auto-save just before the point at which you did Save As... because the very last change you did was at the auto-save mark and it had saved, so your Save As... created an identical file. 
So, in summary, I imagine the issue may be auto-save was not included in your calculation because it was operating on its own time-scale. You could always turn it off Options->Preferences->Autosave Checkpoint Frequency=0 if you want total control of saving.  

- Emergency Escape Hatch 

There is a sneaky way to rollback changes if enough time has not past (enough changes haven't been made to the same file) as long as Options->Preferences->Checkpoint Frequency is non 0. Every checkpoint is a full layout save and there is a rotating set of prior ones that get saved to when the new one gets written. They live in the working directory and have names like your_layout_name.xtc_xx.bkp and five are kept (xx=01 to 05). You will need to look at the timestamp to know which is newest to oldest as the numbers wrap around. To recover any particular one, copy/move it to your own directory and rename it to your_recovered_layout_ name.xtc. Then Open it. The file "xtrkcad.rc" is always the last/current checkpoint file and is newer than the .bkp ones and a similar rename trick works on it. 

--------------- 

Auto_Save is new to V5.2.  We previously had checkpoint (with only one checkpoint) intended to try and cope with failures, but folks were not Saving for extended periods and so ending up losing work. They had an expectation that the program was like Word or Google and would "take care of that".  I'm not sure we are quite all the way there because of the issue that you illustrate that a different mental model is the one where the user wants to use save prior versions of the layout as backups but they would prefer to have the same layout filename as current rather than swapping it and be able to rollback by selecting old versions. It may be that we should support a way of auto-copying the saves out as explicit versions with timestamps so that whether the layout is manually saved or auto-saved there is a version copy preserved for as long as the user wants. Then we could support opening prior versions in some way to rollback changes to that point.  Anyone with thoughts on this area would be helpful. 

Adam

 


Mike Kenefeck
 

Hello,
I am new to the group and have just started using XtrackCAD. I had a saved layout which I later modified and saved under a new filename. However, both files now have the modifications. How should I have saved the different versions?
Mike Kenefeck