2
0

temp_file_linux.odin 315 B

12345678910111213
  1. #+private
  2. package os2
  3. import "base:runtime"
  4. _temp_dir :: proc(allocator: runtime.Allocator) -> (string, runtime.Allocator_Error) {
  5. temp_allocator := TEMP_ALLOCATOR_GUARD({ allocator })
  6. tmpdir := get_env("TMPDIR", temp_allocator)
  7. if tmpdir == "" {
  8. tmpdir = "/tmp"
  9. }
  10. return clone_string(tmpdir, allocator)
  11. }