c++ program to watch directory for alterations
I am looking for a way to make a program in C or C++ that detects if there was any files altered, renamed, moved or deleted in a specified directory for Linux systems. Is there a way to do that?开发者_高级运维
You want inotify (and its man page.)
Look into inotify, I think it's still current.
You can also use a wrapping API, such as glib's GIO GFileMonitor.
Program against FAM. On current Linux systems this service is provided by gamin or a similar application.
You could also use Qt and its QFileSystemWatcher class which can be used quite easily.
精彩评论