How to be notified of file/directory change in C/C++, ideally using POSIX

前端 未结 7 774
无人及你
无人及你 2020-12-08 04:40

The subject says it all - normally easy and cross platform way is to poll, intelligently. But every OS has some means to notify without polling. Is it possible in a reasonab

相关标签:
7条回答
  • 2020-12-08 05:32

    The Qt library has a QFileSystemWatcher class which provides cross platform notifications when a file changes. Even if you are not using Qt, because the source is available you could have a look at it as a sample for your own implementation. Qt has separate implementations for Windows, Linux and Mac.

    0 讨论(0)
提交回复
热议问题