【发布时间】:2011-09-16 22:54:45
【问题描述】:
是否有人知道使用 FileSystemWatcher 来监视具有文件系统 HFS+(Apple)的目录的问题?以下代码适用于本地 windows 目录,但不会触发网络 HFS+ 目录。
var fileWatcher = new FileSystemWatcher
{
Path = Configs.DirWatchedFiles,
Filter = "*.*",
NotifyFilter = NotifyFilters.LastWrite
};
fileWatcher.Changed += FileChanged;
fileWatcher.EnableRaisingEvents = true;
【问题讨论】:
-
我认为 filesystemwatcher 不能很好地处理远程目录。在使用 FAT 或 NTFS 格式化的 NAS 上遇到此问题(我不确定实际的文件系统)。我曾经决定投票而不是依赖观察者。
标签: c# filesystemwatcher