简体   繁体   English

我们向操作系统注册的事件,用于添加到系统的任何文件

[英]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.

相关问题 linux或任何OS中的黑白系统调用与用户调用的区别 - Difference b/w system calls & user calls in linux or any OS 我们可以在未安装任何操作系统的情况下安装KVM吗? - Can we install KVM without any Operating System installed Python os.system() 在 windows 上使用 cmd,我可以通过任何方式更改为我的 Z1D41C5853AF59D137D6083AA258B5C42Z - Python os.system() uses cmd on windows, any ways I can change to my ubuntu terminal? 如何使用ftrace跟踪系统调用事件而不显示Linux内核中的任何其他函数? - How to trace just system call events with ftrace without showing any other functions in the Linux kernel? cpu使用率:整体系统cpu使用率发生变化时是否会触发任何事件 - cpu usage: is there any events fired when overall system cpu usage changes 在主机上更改已装入卷中的文件时,未在docker容器中触发文件系统事件 - File system events not triggered in docker container when files in mounted volume are changed on the host 如何使用 libxcb-xinput 注册事件 - How to register events using libxcb-xinput 可以在32位操作系统上编译的.NET程序在mono下在64位Linux系统上运行而不会出现任何问题吗? - Can a .NET program compiled on 32bit OS be run on 64bit Linux System under mono without any issues? 二进制文件和操作系统 - Binary files and OS 检查os.system()答复 - check for os.system() reply
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM