Waiting until a file is available for reading with Win32

后端 未结 4 608
情话喂你
情话喂你 2020-12-07 01:22

I\'m watching a directory by calling ReadDirectoryChangesW synchronously. When a new file is available, I try to access it immediately with CreateFile

4条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-12-07 01:52

    There's no user-mode API for notifications on a closed file that I'm aware of. The loop you've proposed is really probably the best way. The only other thing you could do would be to watch for CloseFile in a filter driver ala Process Monitor, but yuck...

提交回复
热议问题