C# 使用 FileSystemWatcher 跟踪文件夹连接
是否可以配置 FileSystemWatcher 来监视与文件夹连接点链接的其他文件夹?
例如:
您正在观看 D:
您有 D:\junction 指向 E:\folder
当我在 E:\folder\file.txt 中创建文件时,我希望使用观察程序将其视为 D:\junction\file 。TXT。
这可能吗?
谢谢。
Is it possible to configure a FileSystemWatcher
to watch other folders which are linked in with a folder junction point?
for example:
You are watching D:
You have D:\junction which points to E:\folder
When I create a file in E:\folder\file.txt I want to see it with the watcher as D:\junction\file.txt.
Is this possible?
Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
FileSystemWatcher
不应该监视连接或符号链接...它一次监视一个文件夹。FileSystemWatcher
is not supposed to monitor junctions or symlinks... and it monitors one folder at a time.虽然不支持连接,但我相信硬链接是:
Although Junctions are not supported, I believe Hard Links are:
解决方法是为每个子文件夹(包括连接点)设置 FileSystemWatcher。
A workaround is to setup FileSystemWatcher for each subfolder including junction points.