mirror of
https://github.com/odin-lang/Odin.git
synced 2026-02-12 14:23:33 +00:00
14 lines
314 B
Odin
14 lines
314 B
Odin
#+private
|
|
package os
|
|
|
|
import "base:runtime"
|
|
|
|
_temp_dir :: proc(allocator: runtime.Allocator) -> (string, runtime.Allocator_Error) {
|
|
temp_allocator := TEMP_ALLOCATOR_GUARD({ allocator })
|
|
tmpdir := get_env("TMPDIR", temp_allocator)
|
|
if tmpdir == "" {
|
|
tmpdir = "/tmp"
|
|
}
|
|
return clone_string(tmpdir, allocator)
|
|
}
|