【问题标题】:c# FileSystemWatcher on HFS+ file systemc# HFS+ 文件系统上的 FileSystemWatcher
【发布时间】: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


【解决方案1】:

http://msdn.microsoft.com/en-us/library/system.io.filesystemwatcher.aspx

支持的唯一平台是 Windows 7、Windows Vista SP1 或更高版本、Windows XP SP3、Windows XP SP2 x64 版、Windows Server 2008(不支持服务器核心)、Windows Server 2008 R2(SP1 或更高版本支持服务器核心) , Windows Server 2003 SP2

【讨论】:

  • 我认为平台部分不是指类的使用,而是.NET框架可以安装到的平台。
  • 对,我很确定这需要您正在监控的文件系统上的 .net 框架支持。
  • 感谢 Sascha 和 samack 的回复。这证实了我的怀疑,即我必须找到一种替代方法来监控这些文件。
猜你喜欢
  • 1970-01-01
  • 2013-09-22
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2021-12-22
相关资源
最近更新 更多