Cross platform API for file system monitoring in C?

I am looking for a cross platform library to detect when files in a directory are added or changed.
I know that there is a special OS way for this (inotify for Linux, FindFirstChangeNotification for Windows, etc.).

But is there a platform-independent library that works specifically in C ? (Like QFileSystemWatcher in C ++)

+4
source share
2 answers

inotify is Linux specific if you want to use some of the portable UNIX features you are looking for, for example libfam. This is the name of the library. The full name of the package is files.

fileschanged is a GNU / Linux command line utility that reports that files have been modified.

+1
source

Sounds like a good use case for golang. Just change $ GOOS and / or $ GOARCH and run go build.

Boom is a trivial cross-platform development.

-3
source

Source: https://habr.com/ru/post/1662931/


All Articles