Violet Giraffe
Violet Giraffe

Reputation: 33607

How to get path to the temp folder from native code on Android?

getenv("TMPDIR") returns NULL. Any suggestions on what is temp folder/where to create one?

Upvotes: 7

Views: 11128

Answers (1)

Ruediger
Ruediger

Reputation: 271

As far as I know there is no global /tmp in Android, you should use the cache dir.

Use getCacheDir() to get the "tmp" dir.

http://developer.android.com/guide/topics/data/data-storage.html#filesInternal and http://developer.android.com/reference/android/content/Context.html#getCacheDir%28%29

Upvotes: 9

Related Questions