PDA

View Full Version : Save script when file is write protected



NewsArchive
06-21-2011, 02:19 AM
Hi Friedrich,

my script files are normally write protected (svn - needs lock). If I
accidentally try to save such a file, SB tries to rename the old sb7
file to sb~. Because this is not possible, SB shows an error message. So
far so good.

But: Now, SB has already created a copy of the original sb7 file as sb~
and this file is write protected too. If I now get a lock for my script
file in svn (this removes the write protection), I still can't save my
script, because the existing sb~ file could not get deleted. I first
have to delete this sb~ file in windows explorer.

Perhaps you can check if the file is write protected BEFORE you make a copy.

What do you think?

Markus

NewsArchive
06-21-2011, 02:20 AM
Hi Markus,

We'll check this.

What you can do is to disable the "Make project backup copy during save"
(Tools | Options). This should fix it for your scenario.

Friedrich

NewsArchive
06-22-2011, 01:56 AM
Hi Markus,

Hmm, we tested it here and to be frank, we don't know what you mean.

If you try to save a .sb7 project and an already existing .sb~ backup copy
is write protected, then the IDE will display:

"Error: Cannot create yada.sb~ backup copy. The file yada.sb7 cannot be
saved."

Because the original .sb7 can't be backed up, the IDE does not overwrite it.

IMO, it works as expected. But perhaps I am missing something.

Friedrich

NewsArchive
06-22-2011, 01:56 AM
Yes, that's ok. But the problem is: If you don't have a sb~ file and
your sb7 is write protected, than sb will create such a write protected
sb~ file. This causes the backup copy error message, when you try to
save your script next time.

It would be better, if the sb~ file would only be generated, if the
original file is not write protected. If the sb7 file is write
protected, then you don't need a backup file, because you can't delete /
modify the original file.

I would suggest to check, whether the sb7 file is write protected and if
this is the case, to show an error message like

"Error: The file yada.sb7 is write protected and cannot be saved."

Markus

NewsArchive
06-22-2011, 02:06 AM
We can't reproduce it :-( If the .sb7 is write protected, the IDE gives the
error message and does not create a .sb~ here (if it does not exist) :-(

Friedrich

NewsArchive
06-22-2011, 02:06 AM
Hi Friedrich,

to simplify our conversation, I've made a short screen video. You can
find it here:

http://download.aidaorga.de/save%20problem.avi

Markus

NewsArchive
06-22-2011, 02:07 AM
Hi Markus,

> to simplify our conversation, I've made a short screen video. You can find
> it here:

Aha, okay. I see what you mean.

I agree. We'll change this, thank you!

Friedrich

NewsArchive
06-22-2011, 02:07 AM
I think what Markus says makes sense, Friedrich.

Maybe:
1. When you open a project in SB, detect whether it is write-protected.
2. If it is write-protected, do not create a *.sb~ file. (If one is created
and is also write-protected, than the user will need to go to Windows to
clear that checkbox in order to be able to delete the file.)
3. Have the IDE display something (similar to what Word does in the attached
pic).
4. For a document that is read-only like my Word screen shot, if you make
changes and try to save it, Word goes to its "Save As" interface.

This could save somebody from wasting time making changes to a project and
then being unable to save it.

Jane

NewsArchive
06-22-2011, 02:08 AM
Hi Jane,

> This could save somebody from wasting time making changes to a project and
> then being unable to save it.

Yes, I agree. I would even call it a bug because the IDE should not execute
any write file action if the .sb7 project is set to read-only.

Thanks,
Friedrich

NewsArchive
06-22-2011, 03:09 AM
Improved. Thank you!

---
IMPROVEMENT: (sync from SB8) [SB#106211] IDE: Add an additional check for a
write-protected project file before doing a backup copy.
---


--
Friedrich Linder
Lindersoft
www.lindersoft.com
+1.954.252.3910

SetupBuilder is Windows 7 installation -- "point. click. ship"

-- Official Comodo Code Signing and SSL Certificate Partner

NewsArchive
06-22-2011, 12:22 PM
You're still the man.

Jeff Slarve
www.jssoftware.com
www.twitter.com/jslarve

NewsArchive
06-22-2011, 12:22 PM
>
> You're still the man.
>

:)

Friedrich

NewsArchive
07-10-2011, 01:51 AM
OK in build 3378. Thank you.

Markus Zander