[英]Getting a notification when a local file is accessed in windows
I'd like to get notified when a specific file get accessed (AFAIK, most generally for a Userland
code - by CreateFile()
/ NtCreateFile()
) 我想在访问特定文件时得到通知(AFAIK,最通常用于
Userland
代码-通过CreateFile()
/ NtCreateFile()
)
I already know about FileSystemWatcher
which should do the same within the .NET
environment, But I'm working in plain C
+ WinAPI
. 我已经知道
FileSystemWatcher
,它应该在.NET
环境中执行相同的操作,但是我正在使用普通的C
+ WinAPI
。
As for the type of notification , raising a specified Event
would be perfect, but sending a callback
to be called , will also work. 至于通知的类型,引发指定的
Event
将是完美的,但是发送callback
被称为也可以。
See FindFirstChangeNotification function in WinAPI and related links. 请参见WinAPI中的FindFirstChangeNotification函数和相关链接。
Alternatively, when functionality of that function is not enough, you can use a filesystem filter driver (write yours or use our CallbackFilter product). 或者,当该功能的功能还不够时,您可以使用文件系统过滤器驱动程序(编写您的驱动程序或使用我们的CallbackFilter产品)。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.