开发者

c++ program to watch directory for alterations

开发者 https://www.devze.com 2023-01-13 16:14 出处:网络
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?开发者

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消