Write access forbidden
-
at this time are you seeking a plugin or script who notify if file has already opened in npp or another editor ?
-
Yes an plugin or if there is any setting to change this.
-
document list panel can show you file has set as read only
setting > preference > general > document list panel
-
With document list panel I can´t see that the file is already opened by an other user.
-
yes i have c# code for write a plugin for notify if file in use (file is busy) but not sure it works file who in use by other user
protected virtual bool IsFileLocked(FileInfo file) { FileStream stream = null; try { stream = file.Open(FileMode.Open, FileAccess.Read, FileShare.None); } catch (IOException) { //the file is unavailable because it is: //still being written to //or being processed by another thread //or does not exist (has already been processed) return true; } finally { if (stream != null) stream.Close(); } //file is not locked return false; }
-
I don´t know, how I import this code as plugin.
-
-
I don´t know what I should do with this c# code.
-
Currently you cannot know that another person has already opened the file.
It is because the file is kept open for a very short time (only when reading it or writing it) and then it is immediately closed.BR
-
Ok many thanks for your answer. I know that other editors can lock this file during it is in use.
Is that option planned for development? -
I don’t know but I don’t think so.
You can file a feature request here if you like:
https://github.com/notepad-plus-plus/notepad-plus-plus/issuesBR