title: The file “xxx” couldn’t be opened because there is no such file
body: <p>I would like to open a .txt file and save the content as a String.
  I tried this:</p>
  
  <pre><code>let path = FileManager.default.urls(for: .documentDirectory, in: .userDomainMask)[0].appendingPathComponent("xxx.txt")
  var contentString = try String(contentsOfFile: path.absoluteString)
  print(path)
  </code></pre>
  
  <p>The print result:</p>
  
  <pre><code>file:///Users/Username/Documents/xxx.txt
  </code></pre>
  
  <p>But I get the error:</p>
  
  <pre><code>The file “xxx.txt” couldn’t be opened because there is no such file
  </code></pre>
  
  <p>The file is 100% available</p>
  
  <p>Notice: I working with swift 4 for macOS</p>