title: how to check if a directory is writeable in win32 C/winapi?
body: <p>I know of two methods which are not reliable:</p>
  
  <ul>
  <li>_access() - doesn't work on directories (only checks existence)</li>
  <li>CreateFile() - gives false positives in the presence of virtual store (AFAIK)</li>
  </ul>
  
  <p>Most useful would be a code sample, because the win32 ACL access functions are extremely complicated. Please don't post links to msdn, I've been there and can't for the life of me figure out what I'm supposed to do with all those DACLs, SACLs and security descriptors - I work on a cross-platform app which needs this particular piece of functionality, but otherwise is platform-agnostic. Solutions simpler than accessing Windows ACLs more than welcome.</p>
  
  <p>Edit: you can safely assume that directory permissions won't change while the app is running.</p>