Waiting until a file is available for reading with Win32

后端 未结 4 611
情话喂你
情话喂你 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 02:07

    If you know something about how the file is created, maybe wait until the file stops growing for X seconds, or wait until a sentinel file is deleted. Or sense the state of the program which creates them.

提交回复
热议问题