[X] I have searched the issue tracker for open issues that relate to the same problem, before opening a new one.
[X] This issue only relates to a single bug. I will open new issues for any other problems.
Describe the bug
storage.CanWrite() always return true?
storage.Writer() cannot create a file to write?
I am not sure whether it is bug or I did not do it correctly.
How to reproduce
I can only create a writer if the file exists, or use dialog.ShowFileSave()
Screenshots
No response
Example code
// I can successfully storage.Writer() with sss="content://com.android.externalstorage.documents/document/primary%3A.cc%2Fl", which is file l under .cc on internal storage (/sdcard/), if file l exists. But following fails if file la does not exist.
uri, err = storage.ParseURI(sss + "a")
if err != nil { // not here
return nil, err
}
if uri == nil { // not here
return nil, err
}
b, err := storage.CanWrite(uri)
if err != nil { // not here
return nil, err
} // b is true
wr, err := storage.Writer(uri) // fails here
I think the issue here is that we cannot create files into the "content://" area (AFAIK).
Updated to be a bug that CanWrite is returning true when it shouldn't
Checklist
Describe the bug
I am not sure whether it is bug or I did not do it correctly.
How to reproduce
I can only create a writer if the file exists, or use dialog.ShowFileSave()
Screenshots
No response
Example code
Fyne version
2.2.3
Go compiler version
1.18.4
Operating system
Android
Operating system version
Android 9
Additional Information
No response