简体   繁体   中英

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.

Is there any why that we can register with OS for listening to this kind of events.

I am ready to implement separate solutions for windows, mac and linux if required.

Windows has a concept of filesystem filter drivers (kernel-mode ones). 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.

The alternative approach on windows is to use FindFirstChangeNotification system function to register for notification. This function works differently from the filter driver.

MacOS X doesn't have a concept of filter drivers but they have FSEvents API.

Update: (missed the linux part) on Linux inotify exists.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM