Skip to content
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

Permission denied on write to external SD card #131

Open
clach04 opened this issue Jul 20, 2018 · 1 comment
Open

Permission denied on write to external SD card #131

clach04 opened this issue Jul 20, 2018 · 1 comment

Comments

@clach04
Copy link

clach04 commented Jul 20, 2018

os.mkdir('/storage/YOUR_CARD_HERE/some_dir')

Fails with permission denied.

os.mkdir('/sdcard/some_dir')

Works fine. Permissions are granted for SD card, maybe manifest does not include external SD card?

@luziferius
Copy link

luziferius commented Nov 15, 2018

On Android 4.4 <= version < 5, this requires a rooted device. (Because the permission is only granted for system applications.)
On Android >= 5, QPython has to specify

<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />

https://stackoverflow.com/questions/48172519/oreo-write-external-storage-permission
This seems to be already done in QPython.

Additionally, the user has to manually grant individual access to removable storage using a system file chooser once per app and medium.
See also https://metactrl.com/docs/sdcard-on-lollipop/

So QPython needs an option to bring up such a file chooser. Then the system grants permanent access, after the user chose the SD card root directory.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants