Detect File Change Without Polling [duplicate]

watchdog

Excellent cross platform library for watching directories.

From the website

Supported Platforms

  • Linux 2.6 (inotify)

  • Mac OS X (FSEvents, kqueue)

  • FreeBSD/BSD (kqueue)

  • Windows (ReadDirectoryChangesW with I/O completion ports; ReadDirectoryChangesW worker threads)

  • OS-independent (polling the disk for directory snapshots and comparing them periodically; slow and not recommended)

I’ve used it on a couple projects and it seems to work wonderfully.

Leave a Comment