Monitoring (tail -f) not working as expected under certain situations
-
Hello,
I am using version 7.7.1 64bit on Windows 10 64bit. I can reproduce my problem on both portable version and version setup using installer.
I have an application which write some log in a text file. That log file is kept open always. Each write in that log file is flushed to system. While file is open, NPP cannot auto reload and display new text added while having Monitoring on.
Reproduction:
- Open a text file using an application other than NPP and do not close it
- Open NPP and load above text file.
- Click Monitoring (tail -f) button on toolbar in NPP.
- Set focus to an application other than NPP. It is fine to set focus on application keeping text file open.
- Have that application keeping text in file open to write some text (have it log some data)
- Flush open file without closing.
Under these situation NPP cannot auto reload file.
However;
1- if I click inside NPP editor, file is reloaded immediately and that even cause some text to be selected (reloading and displaying happen before I release mouse button).
2- If I exit writer application that close open text file and NPP automatically reload log file without any focus set to NPPI am not sure if that is a bug or a feature. My part, I would like text file to be auto reloaded always.
Any help is appreciated.
Thanks & regards,
Ertan -
welcome to the notepad++ community, @Ertan-Küçükoglu
yes, unfortunately windows 10 does not trigger a file modification on those files, so without a cyclic re-read of the file update, which happens when you e.g. switch tabs or notepad++ focus, we will not see any changes.
if you like to see something funny:
- monitor your log file in notepad++.
(or open cmd and runping -t 8.8.8.8 > ping.log
and monitor it, see issue #5586) - now open an explorer window with the path to that file.
- click on the file name in windows explorer, then click on any other file, and click again on this file.
- you will notice that, although explorer is running completely independent from notepad++, your file will update the monitoring at the non focused notepad++ window, every time you click on the file name at the explorer window.
best regards.
- monitor your log file in notepad++.