Idea

Jon Abbott avatar image
10 Likes"
Jon Abbott suggested Jacob Gillespie commented

Improve how FlexSim handles read-only model files

FlexSim does not appear to consistently honor the read-only flag of model files. If a model is opened that is set to read-only in Windows, FlexSim sometimes gives an error when saving, but other times it overwrites the file without giving an error, and resets the read-only flag of the file. This is an issue with the latest version of FlexSim (16.2.1 as of this post), as well as previous versions. I have tested this with Windows 7 and Windows 10.

Steps to reproduce this issue:

  1. Open FlexSim.
  2. Create a model with one source
  3. Save to test.fsm
  4. Close FlexSim
  5. In Windows File Explorer, right-click on test.fsm and go to Properties
  6. Enable the read-only flag for the file and click OK
  7. Re-open the model in FlexSim
  8. Add a processor
  9. Click the save icon

FlexSim then appears to overwrite the read-only file. If the overwritten model is set to read-only again via Windows File Explorer, opened in FlexSim and a third item is added (such as a queue), FlexSim now gives a "Saving was unsuccessful" error when saving the model. This mixed behavior also occurs with full-size models, although I cannot determine what causes it to behave one way or another.

Another related issue is that if the user makes changes to a file that is set to read-only, then clicks the "X" in the upper-right corner to close FlexSim and says "Yes" to save the model, it sometimes gives an error that saving was unsuccessful and then quits the program without giving the user another chance to save the file to a different name. We had a team member lose a couple hours of work because he made edits to a model that he didn't realize was set to read-only, and attempted to save the model using this method.

Here are some potential improvements that would be useful if implemented:

  1. FlexSim should consistently honor the read-only flag of a model file
  2. FlexSim should notify the user that a model file is set to read-only when the model is first opened by adding [Read-only] next to the filename in the title bar
  3. When a user selects Save for a model that is read-only, it should instead give a warning and open a Save As dialog, similar to how Microsoft Office handles it
  4. After displaying a file save error when closing, FlexSim should always give the user a second chance to save their model under a different name or in a different location

Thanks and please let me know if you have any questions.

saveread-onlyfile handlingwarnings
· 4
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

Jon Abbott avatar image Jon Abbott commented ·

@Ben Wilson

In case it helps, this is the same issue I reported to you via email on October 6, 2015 as part of Case #12122. Thanks again.

0 Likes 0 ·
Ben Wilson avatar image Ben Wilson ♦♦ Jon Abbott commented ·

Thanks for bringing this up again, @Jon Abbott. These are great suggestions.

0 Likes 0 ·
Phil BoBo avatar image Phil BoBo ♦♦ commented ·

This request is on the development list.

Just for your information on what is happening currently:

When you save your model over a file that exists, it renames the existing file to filename.fsm! (with the explanation point added), then it saves the file as filename.fsm.

It isn't resetting the read-only flag of the file. The read-only file now has a new name (filename.fsm!) and a new file has been generated that is not read-only.

The reason why the third save reports that "Saving was unsuccessful" is because both the filename.fsm and filename.fsm! are now marked as read-only. This causes the rename step to fail and then the save step to fail because you are trying to save over a read-only file. If either file is not set to read-only, then the save step will succeed.

0 Likes 0 ·
Jon Abbott avatar image Jon Abbott Phil BoBo ♦♦ commented ·

Thanks for the clarification, @phil.bobo. To provide some additional background, our teams are using version control software which sets working copy files to read-only unless a lock has been obtained to edit the file. If the user forgets to obtain a lock and then proceeds to edit the file, FlexSim's current read-only file handling gives the impression that the lock has already been obtained. After the read-only file has been replaced with another file, it causes an inconsistency between the working copy of the repository and the server, which involves additional cleanup steps to fix. With the suggested changes above, it should greatly help to prevent this from happening.

0 Likes 0 ·

1 Comment

Jacob Gillespie avatar image
1 Like"
Jacob Gillespie commented

The following has been implemented for FlexSim 17.2:

  1. [Read-Only] is displayed next to the filename in the title bar.
  2. When a user selects Save for a model that is read-only, a Save As dialog is opened.
  3. If the model fails to save, FlexSim will stay open.
· 2
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

Jon Abbott avatar image Jon Abbott commented ·

Thank you, @Jacob Gillespie! This is a very welcome improvement for folks who are using version control software with their models. Any word on when we can expect to see 17.2 beta? I would be happy to test it out when it becomes available. Thanks again.

0 Likes 0 ·
Jacob Gillespie avatar image Jacob Gillespie ♦ Jon Abbott commented ·

@Jon Abbott FlexSim 17.2 won't be released until sometime around August probably.

0 Likes 0 ·

Your Opinion Counts

Share your great idea, or help out by voting for other people's ideas.