title: WinAPI way to determine if a file is accessible/private
body: <p>In win32 c++; is there a way to determine if a folder/file is accessible? You know how if you try to access a certain folder in the C:/Windows directory &amp; you will get a popup saying "This folder is not accessible".</p>
  
  <p>Maybe there is a file attribute constant that signifies that the file is private? Maybe something like FILE_ATTRIBUTE_PRIVATE? </p>
  
  <pre><code>WIN32_FIND_DATA dirData;
  
  while (FindNextFile( dir, &amp;dirData ) != 0 )
  {
      // I made the following constant up
      if ( !(fileData.dwFileAttributes &amp; FILE_ATTRIBUTE_PRIVATE) )
      {
          // file is accessible so store filepath
          files.push_back( fileData.cFileName );
      }
      else // file is not accessible so dont store
  }
  </code></pre>
  
  <p>Or is the only way to know by going:</p>
  
  <pre><code>dir = FindFirstFileEx( (LPCTSTR)directory.c_str(), FindExInfoStandard, &amp;dirData, FindExSearchNameMatch, NULL, 0 );
  
  if ( dir == ??? ) { the file is inaccessible } [/code]
  </code></pre>