title: Can' open File in C++ under MacOs
body: <p>I want to open and read a file in C++. Therefor I wrote the following code:</p>
  <pre><code>#include &lt;fstream&gt;
  #include &lt;iostream&gt;
  #include &lt;string&gt;
      
      ...
      
  string line;
  ifstream file;
  file.open(&quot;./db.config&quot;);
  if (file.is_open()) {
      cout &lt;&lt; &quot;File is open&quot; &lt;&lt; endl;
      getline(file, line);
      file.close();
  }else cout &lt;&lt; &quot;File is not open&quot; &lt;&lt; endl;
  </code></pre>
  <p>This code is written in the main.cpp. I verified that main.cpp and db.config are in the same directory.<a href="https://i.stack.imgur.com/gNQLa.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/gNQLa.png" alt="enter image description here" /></a></p>
  <p>I don't get any Compiletime oder Runtime Errors. It only prints &quot;File is not open&quot;. I also tried it without &quot;./&quot; ( file.open(&quot;db.config&quot;); ), but this also didn't work.</p>