-
Notifications
You must be signed in to change notification settings - Fork 80
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Writing to file : Can't open file (CSV.CSVError.cannotOpenFile: file) #110
Comments
Same issue here. Any solution? |
I had the same problem at first and it was due to the file not existing yet. So I added a condition to create the file if that's the case: if !FileManager.default.fileExists(atPath: path) {
if !FileManager.default.createFile(atPath: path, contents: nil, attributes: nil) {
// throw error or something
}
} Checking if the file is readable or writable could be also useful: if !FileManager.default.isReadableFile(atPath: path) {
// stuff
} |
You have a URL object, just use it directly:
|
same issue. |
1 similar comment
same issue. |
I am having this issue also. Any resolution? I can verify that my file is being created and is readable/writable, but I keep getting the error When I try this:
I am getting |
What I've done to resolve it is to copy the file to the user cache directory. Here is what I do from a file picked using a document picker :
|
The text was updated successfully, but these errors were encountered: