title: FileManager.default.fileExists says documents directory does not exist
body: <p><code>FileManager.default.contentsOfDirectory</code> claims that the documents directory does not exist, even though it clearly does. I'm using Swift 4.2 on my actual iPhone SE running iOS 12.1.2</p>
  
  <p>I am reading the contents of the <code>downloads</code> directory in my app using the following:</p>
  
  <pre><code>do {
      let documentsURL = FileManager.default.urls(for: .documentDirectory, in: .userDomainMask)[0]
      let downloadedContents = try FileManager.default.contentsOfDirectory(at: documentsURL, includingPropertiesForKeys: nil)
      print(downloadedContents)
  } catch {
      print("Error while enumerating contents: \(error.localizedDescription)")
  }
  </code></pre>
  
  <p>This prints the following, telling me that a file exists in the documents directory:</p>
  
  <pre><code>[file:///private/var/mobile/Containers/Data/Application/698F8D51-92AF-4BAB-A212-0A0982090550/Documents/example-file/]
  </code></pre>
  
  <p>(I moved the file there from the caches directory after downloading an in-app purchase, but I don't think that's relevant to this question).</p>
  
  <p>Later in my code, I want to check if the file was downloaded. I'm using the following:</p>
  
  <pre><code>let documentsURL = FileManager.default.urls(for: .documentDirectory, in: .userDomainMask)[0]
  let path = URL(fileURLWithPath: "example-file", relativeTo: documentsURL)
  var isDir : ObjCBool = false
  if FileManager.default.fileExists(atPath: path.standardizedFileURL.absoluteString, isDirectory: &amp;isDir) {
      if isDir.boolValue {
          return true
      } else {
          return false // file exists but is not directory
      }
  } else {
      return false // file does not exist at all
  }
  </code></pre>
  
  <p>But this always returns false, even though <code>contentsOfDirectory</code> showed it exists. </p>
  
  <p>While debugging, I also tried:</p>
  
  <pre><code>let fileManager = FileManager.default
  let documentsURL = fileManager.urls(for: .documentDirectory, in: .userDomainMask)[0]
  po FileManager.default.fileExists(atPath: documentsURL.standardizedFileURL.absoluteString)
  </code></pre>
  
  <p>But this, too, returns false. Now I'm pretty sure I'm just using the <code>fileExists</code> methods incorrectly. </p>
  
  <p>Can anyone spot what I'm doing wrong? </p>