User forums > Using Code::Blocks

Changing read-only for open file

(1/2) > >>

daniloz:
Hi All,

I'm using the svn R6196 (truck) version of C::B and I'm very glad with the new button "File is read-only" in file properties. I'm even more happy with the fact that I can now untick it and modify the file, without having to go somewhere else to remove the read-only attribute.

Everything works fine if I do so with a file which is not open in the editor and then open it, i.e. I can modify the file.

HOWEVER, I've notice that if the file is already open in the editor and then I remove the read-only attribute, I *cannot* modify the file. Then, I have to close and open the file again in order to be able to modify it.

- Is it possible to refresh the file in the editor so that the editor realizes that the file is not read-only anymore?

- Can it be done automatically whenever one changes the read-only attribute?

Btw, I've notice that the inverse is also true, i.e. if the file is open and I *tick* the read-only, the editor still allows me to change the file until I close and open it again.

Thx,
daniloz

MortenMacFly:

--- Quote from: daniloz on March 24, 2010, 10:18:09 am ---HOWEVER, I've notice that if the file is already open in the editor and then I remove the read-only attribute, I *cannot* modify the file. Then, I have to close and open the file again in order to be able to modify it.

--- End quote ---
This is not as easy as you might think. Keep in mind that an editor is a volatile "copy" of your file. But it might be possible... I'll have a look into it...

MortenMacFly:
BTW: I just realised a few race conditions in the current implementation:
1.) If the file is not read-only and opened in and editor and the editor is modified, setting the file to read-only should not be allowed. For now, the editor remains editable but cannot be saved under the same name (bad!!!).
2.) The opposite: If the file is read-only and opened as a read-only editor and then toggled the editor should become editable (that's what you meant I suppose).
3.) Icon handling in the project tree does simply not work properly.

daniloz:
Thanks for your reply...


--- Quote from: MortenMacFly on March 24, 2010, 04:39:55 pm ---2.) The opposite: If the file is read-only and opened as a read-only editor and then toggled the editor should become editable (that's what you meant I suppose).

--- End quote ---

That's exactly what I meant...


--- Quote from: MortenMacFly on March 24, 2010, 04:39:55 pm ---3.) Icon handling in the project tree does simply not work properly.

--- End quote ---

That would be also a neat feature to have... :-)

fubo:
Hi,

what is the status of this issue? 10.05 and latest SVN 6688 still has same behaviour.

Navigation

[0] Message Index

[#] Next page

Go to full version