temp_file_linux.odin 287 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_GUARD()
  6. tmpdir := get_env("TMPDIR", temp_allocator())
  7. if tmpdir == "" {
  8. tmpdir = "/tmp"
  9. }
  10. return clone_string(tmpdir, allocator)
  11. }