[英]Events that we register with the OS for any files added to the System
I want to process certain types of files lets say pdfs, whenever they get copied/downloaded to the system. 我想处理某些类型的文件,只要它们被复制/下载到系统就可以说pdf。
Is there any why that we can register with OS for listening to this kind of events. 有没有为什么我们可以注册OS来听这类事件。
I am ready to implement separate solutions for windows, mac and linux if required. 如果需要,我准备为windows,mac和linux实现单独的解决方案。
Windows has a concept of filesystem filter drivers (kernel-mode ones). Windows有一个文件系统过滤器驱动程序(内核模式)的概念。 Using it your software can intercept any filesystem operations and alter the data or just perform some action (or even prevent the operation).
使用它,您的软件可以拦截任何文件系统操作并更改数据或只执行某些操作(甚至阻止操作)。 You can write such driver yourself or use our CallbackFilter library which includes a pre-created driver and provides an API for use in user-mode.
您可以自己编写此类驱动程序,也可以使用我们的CallbackFilter库,其中包含预先创建的驱动程序,并提供用于用户模式的API。
The alternative approach on windows is to use FindFirstChangeNotification system function to register for notification. Windows上的替代方法是使用FindFirstChangeNotification系统函数来注册通知。 This function works differently from the filter driver.
此功能与过滤器驱动程序不同。
MacOS X doesn't have a concept of filter drivers but they have FSEvents API. MacOS X没有过滤器驱动程序的概念,但它们具有FSEvents API。
Update: (missed the linux part) on Linux inotify exists. 更新:(错过了linux部分)Linux inotify存在。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.