title: Migrating file operations from Linux to Windows
body: <p>How can I make this code, that works in Linux, work in Windows. Ideally I need to have a version of it that works on both platforms.</p>
  
  <pre><code>#include &lt;fcntl.h&gt;
  #include &lt;iostream&gt;
  using namespace std;
  
  int main()
  {
      int mode = O_TRUNC | O_RDWR | O_CREAT;
      int myFilDes;
      myFilDes = open ("/home/user23/data.bin", mode, S_IRUSR | S_IWUSR);
      if(myFilDes &lt; 0)
          cout&lt;&lt;"Create failed!"&lt;&lt;endl;
      close(myFilDes);
  }
  </code></pre>