It is necessary to check the changes in the file with a certain frequency, and if the file has been changed, then the program only needs to read this change.

Tell me how to correctly, and most importantly, optimally in time and resources to do this using Qt5 ?

PS File size may be different.

  • Does the file system support updating the file modification time? - Vladimir Gamalyan

1 answer 1

If you carefully read the documentation, then there is such a functionality.
QFileSystemWatcher Class

... QFileSystemWatcher watcher; watcher.addPath("/My/Path/To/The/File"); QObject::connect(&watcher, SIGNAL(fileChanged(const QString&)), receiver, SLOT(handleFileChanged(const QString&))); ...