Currently, I have an application which I am porting from Linux to Windows. I would prefer to use boost where possible.
I currently have the following snippet which I want to port, which is pretty self-explanatory.
return access(backupFile.c_str(), R_OK) == 0;
The problem is that is seems like boost::filesystem does not have a direct equivalent. That is, I can do the following:
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() == ???)
The permissions() enum can be found here. 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.
Is there an easier way? Is my interpretation on the behavior correct?
(Of course, I can always attempt to open the file for reading, but that is not the goal of this question).