Working with write protected file bug

Hi there,

i have a Rhino file which is published with a PlugIn. The file is deliberately write protected, it acts as a template file. If a user opens the file directly (it is not placed in Rhino’s template folder), he can make changes and once he tries to save, he is prompted to use SaveAs. So far so good.

grafik

The problem is, the new saved file is still in read only mode, so if i tries to save again, he must save under a new name. If the user presses OK in above dialog, he gets this below error if he tries to overwrite the file which he already used SaveAs on:

grafik

Is this the expected behavior when working with write protected files ?

thanks,
c.

@JohnM - do you know?

-Pascal

@tim and I did some work in the recent past regarding checking to see if a file was read-only or not when saving/opening. If I remember correctly it had to do with saving files in a Google Drive folder which would occasionally lock a file while syncing when Rhino was attempting to save. I have not tried what is mentioned above but if it is reproducible and seems wrong please log a bug and we can take a look.

@clement, @JohnM - I did this:

  • Make a 3dm file, junk.3dm, on my disc read-only.
  • Open the file in Rhino, seeing the expected notice about read-only.
  • Save
  • Save the file as Junk2.3dm
  • Close and open Junk2.3dm.
  • Make a change
  • Save
    The file is saved normally, no need to rename.

Clement, I think this is what you expect but are not seeing?

-Pascal

Hi all, thank you for taking a closer look. I can repeat the following:

  • Open write protected file “test.3dm” (it is shown in the title that it is read only)
  • attempt to _Save, it (eventually*) gives warning to use _SaveAs and asks for a location
  • name it MyNewFile.3dm

now the “read only” hint is still shown in the title which reads “MyNewFile.3dm” so the saved file is still write protected. If you then hit _Save again, it prompts you another time to save under a different name, try to overwrite “MyNewFile.3dm”. Then you get the two dialogs posted above. I think if _SaveAs was used when first saving the new file, this should not be write protected again as it was saved under a new name.

@Pascal, no, i did not reopen “Junk2.3dm” as in your example.

(*) if Rhino is closed and you open a write protected file by double clicking it, you will not get any warning message when an attempt is made using _Save. Rhino just asks for a new location.

_
c.

Yeah, I did it both by saving directly and by closing and reopening, both worked here - let me have another try, looking at your notes.

Verified… here at least, the “(read only)” disappears as soon as I save to a new name.

-Pascal

Hi @Pascal,

can you test this in V6 as well ? I do all tests first in V6 (Win), then V7 (Win), then V7 (Mac).

thanks,
c.

Also seems correct in V6. (windows) I wonder if there is a Windows setting…

-Pascal

Hi @Pascal, it may have something to do with an outdated OS.

with Rhino closed, i can see a difference when double clicking a write protected file in V6 (Win) and V7 (Win). Using V6, i do not get a “Read only file” warning dialog when the file is opened, but i get this dialog in V7. It could be that on the System V6 runs on, i have someday checked the “Do not show this message again” checkbox.

Using V7 (Windows 10), if i choose to open as read only, it works flawless, once saved under a new name, this newly named file is not write protected anymore. I think it’s time to abandon V6 altogether.

thanks,
c.

1 Like