如何通知在C / C ++的文件/目录的变化,最好使用POSIX [英] How to be notified of file/directory change in C/C++, ideally using POSIX
本文介绍了如何通知在C / C ++的文件/目录的变化,最好使用POSIX的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
主题说明了一切 - 通常容易,跨平台的方式是轮询,智能化。但是,每一个操作系统都有一些手段没有投票通知。是否有可能在一个合理的跨平台的方式? (我只真正关心Windows和Linux,但我使用的是Mac,所以我想POSIX可帮助?)
The subject says it all - normally easy and cross platform way is to poll, intelligently. But every OS has some means to notify without polling. Is it possible in a reasonably cross platform way? (I only really care about Windows and Linux, but I use mac, so I thought posix may help?)
推荐答案
Linux用户可以使用 inotify的
Linux users can use inotify
inotify的是一个Linux内核子系统
它提供文件系统事件
通知。
inotify is a Linux kernel subsystem that provides file system event notification.
一些好吃的东西为Windows研究员:
Some goodies for Windows fellows:
- File Change Notification on MSDN
- "When Folders Change" article
- File System Notification on Change
这篇关于如何通知在C / C ++的文件/目录的变化,最好使用POSIX的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文