Awesome Open Source
Awesome Open Source

catch logo

Build Status

What is Panoptes?

Panoptes is a cross-platform file watcher library for C++17 using std::filesystem and native interfaces. It is tested on Linux, Windows and macOS platforms with the help of the test framework Catch2. The main target is to unify the APIs of Windows, Linux and macOS. In an earlier stage Panoptes was a fork of Axosoft nsfw.

What is supported?

Panoptes is observing all changes inside of a given directory. This includes add, modify or remove events. Even the changes inside of subdirectories (recursively) will be detected. Edge cases are covered too in case a file or directory will be moved in or out of the watched directory.

Which native APIs are used by Panoptes?

How to use it

  1. Include Panoptes to your project.
  2. Look into the small console example how to call and use the FileWatcher.

Conan

A conan package of the last release, can be created with the help of conanfile.py.

Wish list

Add rename/move support

Instead of detecting a rename/move event, Panoptes is detecting one add and one remove event. Under Linux in general and since Windows 10, it is possible to connect the add and remove event with each other to one rename/move event. But under MacOS (10.12) it seems to be not possible, because of the internal buffer system.

Direct return of the event in case it was detected

macOS buffers and stashes all detected events over a given time. This means that the callback of the native API is not returning immediately after a filesystem change happens. It waits for some time and then returns a batch of events. If the underlying filesystem is HFS+ (old filesystem of macOS) the buffering time has to be at least 1 second. To unify this experience Panoptes adds a buffer system to Linux and Windows, inspired by macOS. But it would be better if we find a way for macOS to return the results directly, instead of using for every platform a buffer system. With the new macOS filesystem APFS, it is possible to set the buffering time to some nanoseconds.

More


Get A Weekly Email With Trending Projects For These Topics
No Spam. Unsubscribe easily at any time.
C Plus Plus (370,326
Linux (16,471
Windows (9,689
Macos (8,829
Cross Platform (3,279
Notifications (2,676
File (2,162
Filesystem (1,902
Directory (512
Conan (305
Modern Cpp (268
Notifier (243
Watcher (226
Recursive (173
Related Projects