[英]FileSystemWatcher changed event not firing for recently opened file
I implemented FileSystemWatcher
in a windows forms application. 我在Windows窗体应用程序中实现了
FileSystemWatcher
。 Changed event is working when I open a file (say pdf-1) for the first time. 当我第一次打开文件(比如pdf-1)时,更改的事件正在运行。 But when I open the same file for the second time within short span of time, changed event is not firing.
但是当我在短时间内第二次打开同一个文件时,更改的事件不会触发。 But it is firing when I open another file (say pdf-2).
但是当我打开另一个文件(比如pdf-2)时它会被触发。 Again the changed event is firing for the first file (pdf-1) only if I open it after some time (say 1 or 2 hours).
只有当我在一段时间后打开它(比如1或2小时)时,更改的事件再次触发第一个文件(pdf-1)。
I set the InternalBufferSize
to 16KB and the NotifyFilters
used are LastAccess
, LastWrite
, FileName
and DirectoryName
. 我将
InternalBufferSize
设置为16KB,使用的NotifyFilters
是LastAccess
, LastWrite
, FileName
和DirectoryName
。
I am unable to find out the issue. 我无法找出问题所在。 Can anyone help me out?
谁能帮我吗?
I have seen similar results with FileSystemWatcher for RAID controller disks, SCSI disks and regular IDE disks with write cache enabled . 我已经看到FileSystemWatcher对于RAID控制器磁盘,SCSI磁盘和启用了写入缓存的常规IDE磁盘的类似结果 。
I also experienced a lot of other errors that may have been caused by thread synchronization problems . 我还遇到了许多可能由线程同步问题引起的其他错误。 Here is another description of this problem .
这是对这个问题的另一种描述 。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.