title: Check for writing permissions to file in Windows/Linux
body: <p>I would like to know how to check if I have write permissions to a folder.</p>
  
  <p>I'm writing a C++ project and I should print some data to a result.txt file, but I need to know if I have permissions or not.</p>
  
  <p>Is the check different between Linux and Windows? Because my project should run on Linux and currently I'm working in Visual Studio.</p>