QFileSystemWatcher::fileChanged not being triggered, only once the file is closed
-
I am trying to monitor a file in real time while it is used by another application, but QFileSystemWatcher::fileChanged won't trigger after every changes, only once the file is closed by the application, which is when the application itself is closed.
Is there a way for me to monitor it like i want ? i don't want to use some kind of loop constantly pulling the file data.
-
@J.Hilk But it is flushed after each add though, i can manually check changes using visual code and see lines being added while the other application is running, just that (on window at least), QFileSystemWatcher::fileChanged does not trigger until the file is closed.
-
Which platform ?
-
@dheerendra Windows 10 64bit
-
Hi
Seems to be a long standing issue/ implementation limitation.
https://bugreports.qt.io/browse/QTBUG-41119 -
@mrjj Yeah sadly i have read that and hoped there was an alternative.
Well i decided to use QTimer and read only from the last position i was at last iteration.
Since this is a log file, i don't have to worry about modified or deleted data, it can only be added lines.