7

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

Violet Giraffe
  • 31,078
  • 43
  • 182
  • 317
  • 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

8

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
  • 15,944
  • 193
  • 67
  • 96
Ruediger
  • 261
  • 1
  • 4