title: Code for checking write-permissions for directories in Win2K/XP
body: <p>Greetings!</p>
  
  <p>I am trying to check directory write-permissions from within a Windows MFC/ATL program using C++. My first guess is to use the C-standard _access function, e.g.:</p>
  
  <pre><code>if (_access("C:\mydir", 2) == -1)
     // Directory is not writable.
  </code></pre>
  
  <p>But apparently on Windows 2000 and XP, _access can't determine directory permissions. (i.e. the Security tab in the Properties dialog when you right-click on a directory in Explorer) So, is there an elegant way to determine a directory's write-permissions in Windows 2000/XP using any of the Windows C++ libraries? If so, how?</p>
  
  <p>Thanks</p>
  
  <p>Evan</p>