Dear Elias and all others,
my attempt to create a directory with os.Mkdir("xxx", os.ModePerm) failed with the message
mkdir xxx: read-only file system
although I managed to set WRITE_EXTERNAL_STORAGE and all possible other permissions by using
a proper import statement like
import ( _ "gioui.org/app/permission/storage" ... )
This behaviour is mysterious to me.
How to properly create directories on Android ?
Best,
Otfried
Can you try use the `DataDir` (https://pkg.go.dev/gioui.org@v0.7.1/app#DataDir) folder, that is exclusive for your app and you can use it.
If you want to read/write outside of the app sandbox you need permission, but the permission need to be performed by the user explicitly, see https://git.sr.ht/~whereswaldon/gio-x/tree/v0.7.1/item/explorer/explorer_android.java#L149-159
--
Lucas Rodrigues
inkeliz@inkeliz.com
On Fri, Jan 10, 2025, at 12:34 AM, Otfried Geffert wrote:
> Dear Elias and all others,
>
> my attempt to create a directory with os.Mkdir("xxx", os.ModePerm)
> failed with the message
> mkdir xxx: read-only file system
>
> although I managed to set WRITE_EXTERNAL_STORAGE and all possible other
> permissions by using
> a proper import statement like
> import ( _ "gioui.org/app/permission/storage" ... )
>
> This behaviour is mysterious to me.
>
> How to properly create directories on Android ?
>
> Best,
> Otfried