7

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

Violet Giraffe
  • 32,368
  • 48
  • 194
  • 335
  • 3
    You may want to look at http://stackoverflow.com/questions/7595324/creating-temporary-files-in-android-with-ndk , which seems to address the exact problem that you have. – Samveen Apr 26 '12 at 11:45

1 Answers1

9

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

Unheilig
  • 16,196
  • 193
  • 68
  • 98
Ruediger
  • 271
  • 1
  • 4