Swift 3.0 FileManager.fileExists(atPath:) always return false

前端 未结 7 2132
一向
一向 2021-02-05 00:38

When I use method .fileExists(atPath:)to judge whether the file is exist in file system, the method always return false to me. I checked the file system and the fil

7条回答
  •  感情败类
    2021-02-05 01:04

    Just use path instead of absoluteString to remove file://

    FileManager.default.fileExists(atPath: URL.init(string: "your_url")!.path)
    

提交回复
热议问题