Not able to save the file
-
whenever i try to save the file, i am getting error message “this file cannot be save and it may be protected do you want to launch notepad++ in administrator mode?” Could anyone please help me out?
-
It appears that you have a permissions issue on the file, and your current user doesn’t have write permission. You will have to make sure you have write permission on the file before opening it in Notepad++, editing, and trying to save.
-
And I’ve mentioned this before that I get this popup occasionally, on various files that I do have permission to write to. I merely attempt to save again and it succeeds.
This sounds different from @Ashwin-Babu 's problem, however.
-
@alan-kilborn @Ashwin-Babu
Do you use “Enable session snapshot and periodic backup” enabled?
Because AFAIK, this is an extension to that dreadful feature.Notepad++ failed to open the file for writing, either because of permission or because it is locked by another process. Notepad++ doesn’t know the exact reason.
So instead of just telling it to the user, Notepad++ is doing a favor, saving the file to the snapshot, reopening itself in Administrator mode which is a terrible idea and hopes that save will succeed. Save will still fail if file is locked by application. If it was a permission issue this may just screw permissions further leading users to always work in Administrator mode which is still a terrible idea.
But as so often happens, when Notepad++ is trying to appease the lazy users it screws the naïve ones.
I believe that if you will disable the snapshot you would just get a “failed to save” message and have to figure out by yourself why.
-
@gstavi said in Not able to save the file:
Do you use “Enable session snapshot and periodic backup” enabled?
Nope.
I agree that feature is “dreadful”.When it happens to me it is a random event where Notepad++ should really have no trouble saving the file (not being used by some other process).
-
@alan-kilborn
Yes, I browsed this code a few months ago and thought it was only for the snapshot part of the ‘if’. But now I tested and I saw I get it as well. Wonder where it saves the temporary file. I hope it get deleted afterward.