let documentsURL = try! FileManager().url(for: .documentDirectory, in: .userDomainMask, appropriateFor: nil, create: true) let fooURL = documentsURL.appendingPathComponent("foo.html") let fileExists = FileManager().fileExists(atPath: fooURL.path) if fileExists==true { print("already existed") } else { print("no file") }
https://stackoverflow.com/questions/1638834/how-to-check-if-a-file-exists-in-documents-folder
No comments:
Post a Comment