**
问题
**
1 inotify 如何检测事件发生
a 首先生成 特定文件fd mINotifyFd = inotify_init();
b 特定文件fd 与 目录绑定
c 通过 读 特定文件fd 可以得到什么事件发生。
2 epoll 是否支持 普通文件?
支持 管道,fifo。套接字,消息队列,终端,设备,但是不支持普通文件 或者 目录的fd
3 epoll inotify 都是阻塞的(epoll_wait, read 会阻塞)。所以如何 将两个结合起来呢?
把 inotify 生成的文件句柄,交给 epoll 进行处理。epoll 只监测一个句柄 (inotify 生成的文件句柄)
参考链接:
linux 系统调用 inotify & epoll