4coder » Forums » Overwriting files marked as read only
McMassiveNZ
2 posts
#12722 Overwriting files marked as read only
1 month, 2 weeks ago

Hi again,

Sorry if this question has been asked before, is there a way to save over a file in 4coder that has been marked as read only? I know this sounds weird, but for example. If I have my project in some kind of source control like perforce, files are marked as read only unless they are checked out.

I find it a better workflow to be able to over write files that aren't checked out and just do a reconcile of work via perforce but I can't seem to over write read only files in 4coder.

Thoughts on this? I know other editors like sublime text or even visual studio will ask if you want to overwrite the file but still allow you to do it anyway.

Maybe this is something I can implement myself with the custom stuff?

Thanks,
Wil
mrmixer
Simon Anciaux
265 posts
#12740 Overwriting files marked as read only
1 month, 2 weeks ago

I believe that you can use buffer_get_setting and buffer_set_setting in a custom function to remove the read only flag and then save normally or open a query bar if you want to ask for confirmation. I haven't tested it though.
Mr4thDimention
Allen Webster
266 posts
2 projects

Heyo

#12764 Overwriting files marked as read only
1 month, 2 weeks ago

I've had another perforce user ask a similar sort of question. Although I have to admit I'm a bit confused about this now.

First of all, the 4coder API allows you to set settings on buffers to make read only buffers, as mrmixer said, but that doesn't help with read only files.

I have been planning to just have a dialogue warning the user that their attempt to save a file failed whenever they attempt to save a read only file. But it sounds like you're looking for something a little different.

I am not sure what behavior you are asking for. Isn't the entire point of a read only file that they cannot be overwritten? Or are you saying that other editors just save over them anyway by disabling the read only flags?

Please clarify if you can.
DarkSeed
Ivan Braidi
1 posts

www.arkhamlegacy.com

#12825 Overwriting files marked as read only
1 month, 1 week ago

Hi Allen, I think that the desired functionality is that when you try to save a read-only file, 4coder pops out a dialog that says something like:

"This file is marked as read-only. Do you want to overwrite it anyway?" -> YES / NO

A lot of other code editors do this thing.
Benno
5 posts
#12839 Overwriting files marked as read only
1 month, 1 week ago

DarkSeed
Hi Allen, I think that the desired functionality is that when you try to save a read-only file, 4coder pops out a dialog that says something like:

"This file is marked as read-only. Do you want to overwrite it anyway?" -> YES / NO

A lot of other code editors do this thing.


Yes thats the functionality i was asking about on your stream some time ago,
but as you said its a little bit strange because you throw away the concept of read-only.
I would like to have a warning only, telling you that the file can't be saved because it is
read-only. That way you don't screw over any other program.