title: QFile: directory not found
body: <p>I need to write a console application that takes a file, it opens it, and then it calls another procedure based on the information inside the text file.
  The only problem is that <code>QFile::errorString()</code> returns:</p>
  
  <blockquote>
    <p>No such file or directory.</p>
  </blockquote>
  
  <p>I have been using this implementation in all the programs I had to, and yes, the file exists at that directory.</p>
  
  <p>The code is:</p>
  
  <pre><code>QFile fileName("D:/file.txt");
  QString read_from_file;
  if(fileName.open(QIODevice::ReadOnly)){
      QTextStream in(&amp;fileName);
      while(!in.atEnd())
      {
          read_from_file = in.readLine();
          qDebug()&lt;&lt;read_from_file;
      }
      fileName.close();
   }
  qDebug()&lt;&lt;fileName.errorString();
  </code></pre>