Deleting content from files also opened in other programs
JL LMNCHR last edited by
With the latest update (220.127.116.11), when having a log file open (from Glassfish), when trying to delete its content to clean it, I get the message:
Please check whether if this file is opened in another program
Previously, it had always let me delete the content of files even if other programs had it open.
For me that is the desired behavior. Does anyone know how I can get it without having to install an older version?
PeterJones last edited by PeterJones
Sorry, it appears none of the regulars have thought of a workaround for you.
The remainder of this post will show my personal biases regarding this issue; you do not have to agree with me, but my advice in this situation cannot be separated from those biases.
The recent update has Notepad++ doing the right thing, and not being able to overwrite a file that has another process actively writing to it. Trying to erase/empty a logfile while the program is writing to that logfile seems like a bad thing (IMO).
Imagine the scenario when Notepad++ polls the file and shows you most recent contents, you start editing, the external process writes new critical data to the log file, but before Notepad++ polls again to see if it’s been changed, you save and Notepad++ blindly lets you do so: in this circumstance, you just lost the critical data without knowing it.
The way to protect you from this is to honor filesystem locks, which is what Notepad++ now does.
I doubt that the developers would willingly revert that intentional change, and if someone were to make such a feature request, I would lobby against it. Honoring file locks held by external processes is the right thing to do.
If you want the B.A.D. implementation where it doesn’t honor external write-locks, I would suggest you roll back to a version that does what you want. I, on the other hand, will quietly continue celebrating the victory of data integrity that this particular fix represents, and will continue to make use of the new codebase going forward.