summaryrefslogtreecommitdiff
path: root/lib/fileutil/tmpdir.myr
diff options
context:
space:
mode:
Diffstat (limited to 'lib/fileutil/tmpdir.myr')
-rw-r--r--lib/fileutil/tmpdir.myr12
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/fileutil/tmpdir.myr b/lib/fileutil/tmpdir.myr
new file mode 100644
index 0000000..786a151
--- /dev/null
+++ b/lib/fileutil/tmpdir.myr
@@ -0,0 +1,12 @@
+use std
+
+pkg fileutil =
+ const tmpdir : (-> byte[:])
+;;
+
+const tmpdir = {
+ match std.getenv("TMPDIR")
+ | `std.Some d: -> d
+ | `std.None: -> "/tmp"
+ ;;
+}