Feature request: "Monitoring (tail -f)" should work for files that do not currently exist (or files that temporarily vanish)
The monitor (tail -f) feature is nice, but it only monitors files that continuously exist (are appended to by the application that is modifying the file). If, however, the file temporarily vanishes (for instance, if instead of appending to the file, an application outright overwrites the existing file or deletes the existing file prior to recreating it) then notepad++ disconnects and the open file within Notepad++ is marked as no longer existing (red). It would be nice when monitoring is active if non-existence of the file is considered temporary and instead of disconnecting, the file system is monitored so that if and when the file exists again, the monitoring continues.
don’t get me wrong but this doesn’t make sense to me.
You can only monitor what exists. How should a logic distinguish between
file is gone and file is temporarily gone or file file be created soon?
From logical point of view, how would you try to solve this?
This is actually the behavior of
tail -F(capital F) in Linux so it seems like a valid request to me.
Don’t know if it is practical to implement but that is another story.
I think that it is possible to register for events from the file system on changes to directories but I am not sure that such functionality should be built into Notepad++ when it already has ‘freeze’ issues when network drives disconnect. In my opinion the entire ‘tail -f’ concept is more suitable to a plugin than core Notepad++ functionality.
to be honest, I never used the F switch and as I first read your post I thought WHAAT?? ;-)
So in this case you would say, instead of monitoring a file, monitor the directory
and filter by file, correct?
Interesting - I know there was an issue about directory monitoring instead
of file monitoring but can’t remember what it was.
To be honest, I was unaware of it as well until I saw this post and went to read tail’s man page to see if it can support it.
My point is that however this feature is implemented we don’t want it to do active polling.
When the file is present I hope that there is a way for a thread to block on it until it is modified.
When there is no file we need a mechanism to find out that it was created.