Unsolved Best way to monitor a log file ?
-
Hi, I'm developing a small app in which I have to check in real time an updating log file from another program. What is the best way to do this ?
-
@Echiqueur
There is little detail here, so best answer may vary. Qt has the QFileSystemWatcher Class,fileChanged
signal, if you want to know when a file is modified. Or you can just open for read and reads will be satisfied when new data is available (https://stackoverflow.com/questions/2696976/implement-tail-f-in-c). Depends what you are looking for, how data is written to the file, what shared open modes it allows, etc. -
@JonB I've tried to use QFileSystemWatcher but I feel like the file is updating too quickly and that it's not working properly. I don't know how I forgot to simply open the file for read lmao, I'm gonna try this. Thanks !