PRB: ReadDirectoryChangesW Not Giving Consistent Notification (245214)



The information in this article applies to:

  • Microsoft Win32 Application Programming Interface (API), when used with:
    • the operating system: Microsoft Windows NT 4.0
    • the operating system: Microsoft Windows 2000
    • the operating system: Microsoft Windows XP

This article was previously published under Q245214

SYMPTOMS

If you are using ReadDirectoryChangesW or FindNextChangeNotification to be notified when files are accessed you may not be notified when expected if the file is accessed soon after you were last notified.

CAUSE

Windows NT and Windows 2000 only updates the Last Access Time every hour for performance reasons.

RESOLUTION

To find out if a file has been accessed more frequently then hourly use GetFileTime().

STATUS

This behavior is by design.

MORE INFORMATION

Steps to Reproduce Behavior

  1. In explorer right-click a file and choose Properties from the Context menu to access the file. Note the Accessed time should be the current time.
  2. Wait 10 minutes and check the Accessed time again. The time is not updated.
  3. Wait more then one hour and check the Accessed time again. The Accessed time is updated to the current time.

REFERENCES

For additional information, see the following article or articles in the Microsoft Knowledge Base:

188321 FindFirstChangeNotification May Not Notify All Processes


Modification Type:MajorLast Reviewed:12/17/2003
Keywords:kbAPI kbFileIO kbKernBase kbprb KB245214