Accessing the /cache directory in the Android filesystem
Asked Answered
B

1

9

How can I write a file in the /cache directory? I continue to get a FileNotFoundException (Permission denied).

Someone told me about the android.permission.ACCESS_CACHE_FILESYSTEM but i can't find it in the Android reference.

Any help will be appreciated.

EDIT: i'm using level 13 apis

Boehm answered 9/1, 2012 at 9:42 Comment(0)
W
28

You can only write to the cache directory of your own application: use context.getCacheDir() to get its location.

Windpipe answered 9/1, 2012 at 9:46 Comment(4)
Thank you clemp6r, but i need to write exactly the /cache directory (if possible) and not the one owned by the application.Boehm
You can't unless the device is rooted.Windpipe
Thank you for your time clemp6r, not a solution for me but your is a great comment.Boehm
@Windpipe what about a system app?Clancy

© 2022 - 2024 — McMap. All rights reserved.