是FindFirstChangeNotification使用Windows上的文件系统更改通知最好API? [英] Is FindFirstChangeNotification the best API to use for file system change notification on windows?

查看:192
本文介绍了是FindFirstChangeNotification使用Windows上的文件系统更改通知最好API?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是新来编程窗口和我想要得到通知的所有更改文件系统(类似的信息FileMon的Sysinternals出品的显示器,而是通过一个API)。针对每个FindFirstChangeNotification(非网络,非substed)驱动器我最好的选择还是有其他更合适的C / C ++的API?

I'm new to windows programming and I'm trying to get notified of all changes to the file system (similar to the information that FileMon from SysInternals displays, but via an API). Is a FindFirstChangeNotification for each (non-network, non-substed) drive my best bet or are there other more suitable C/C++ APIs?

推荐答案

FindFirstChangeNotification 是好的,但对于稍微最终权力,你应该使用 ReadDirectoryChangesW。(事实​​上,它甚至建议的文件中!)

FindFirstChangeNotification is fine, but for slightly more ultimate power you should be using ReadDirectoryChangesW. (In fact, it's even recommended in the documentation!)

它不需要一个函数指针,它确实需要您手动去code原始缓冲区,它采用统一code文件名,但它通常是更好的,更灵活。

It doesn't require a function pointer, it does require you to manually decode a raw buffer, it uses Unicode file names, but it is generally better and more flexible.

在另一方面,如果你想要做的FileMon做什么,你应该做的FileMon做什么以及使用的 IFS创建和安装一个文件系统过滤器

On the other hand, if you want to do what FileMon does, you should probably do what FileMon does and use IFS to create and install a file system filter.

这篇关于是FindFirstChangeNotification使用Windows上的文件系统更改通知最好API?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆