title: Porting access(2) Linux system call to boost::filesystem
body: <p>Currently, I have an application which I am porting from Linux to Windows.  I would prefer to use boost where possible.</p>
  
  <p>I currently have the following snippet which I want to port, which is pretty self-explanatory.</p>
  
  <pre><code>return access(backupFile.c_str(), R_OK) == 0;
  </code></pre>
  
  <p>The problem is that is seems like boost::filesystem does not have a direct equivalent.  That is, I can do the following:</p>
  
  <pre><code>namespace fs = boost::filesystem;
  
  if (!fs::is_regular_file(filename, ec))
      return false;
  
  fs::file_status s = fs::status(filename);
  
  // Which permissions should I be testing for?
  if (s.permissions() == ???)
  </code></pre>
  
  <p>The permissions() enum can be found <a href="http://www.boost.org/doc/libs/1_55_0/libs/filesystem/doc/reference.html#Enum-perms" rel="nofollow">here</a>. However, I as I read it, it is not a direct trananslation, as I would have to test to see if I am in the applicable group and if the group's permissions are also available.</p>
  
  <p>Is there an easier way? Is my interpretation on the behavior correct?</p>
  
  <p>(Of course, I can always attempt to open the file for reading, but that is not the goal of this question).</p>