Monday, July 15, 2024
HomeiOS Developmentswift - iOS 16: `fileExists(atPath:)` at all times returns `false`, however `Information(contentsOf:)`...

swift – iOS 16: `fileExists(atPath:)` at all times returns `false`, however `Information(contentsOf:)` returns `true` for a similar URL


I do know these information exist as a result of I chosen them from a SwiftUI .fileImporter dialog. I even made positive to name .startAccessingSecurityScopedResource() and . stopAccessingSecurityScopedResource appropriately.

What boggles my thoughts is that this works as anticipated, simply superb, each time:

Information(contentsOf: url)

however this returns false each time:

FileManager.default.fileExists(atPath: url.path())

Much more weird, if I choose a listing, this returns its contents as anticipated!

FileManager.default.contentsOfDirectory(at: url, includingPropertiesForKeys: nil)

What is going on on right here?



Supply hyperlink

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisment -
Google search engine

Most Popular

Recent Comments