title: Win32 C++ ReadDirectoryChangesW "creation" and "modification" of file difference detect?
body: <p>Here is the problem: I monitor a directory using Win32 API <a href="http://msdn.microsoft.com/en-us/library/aa365465%28VS.85%29.aspx" rel="nofollow noreferrer">ReadDirectoryChangesW</a> function. And I need to distinguish between newly created files and modified files. But there are problems... as always :(</p>
  
  <p>Cases:</p>
  
  <ol>
  <li>I monitor directory for new/modify (<code>FILE_NOTIFY_CHANGE_FILE_NAME | FILE_NOTIFY_CHANGE_SIZE</code>). <strong>Problem:</strong> After file creation, new file event + modify file event is triggered. But i need only one. How can I avoid that? When file is modified I get what I want :).</li>
  <li>I monitor directory only for new file (<code>FILE_NOTIFY_CHANGE_FILE_NAME</code>) - NO PROBLEM.</li>
  <li>I monitor directory only for modify file (<code>FILE_NOTIFY_CHANGE_SIZE</code>). <strong>Problem:</strong> When a new file is, modify action is fired along with file creation event. How can I avoid that?</li>
  </ol>
  
  <p>Of course, I implemented some workarounds. But, I want to know if there any elegant way of handling the problems I described.</p>