summary refs log tree commit diff stats
path: root/lib/pure/os.nim
diff options
context:
space:
mode:
Diffstat (limited to 'lib/pure/os.nim')
-rwxr-xr-xlib/pure/os.nim6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/pure/os.nim b/lib/pure/os.nim
index f7d22ca06..d9b81365f 100755
--- a/lib/pure/os.nim
+++ b/lib/pure/os.nim
@@ -1130,6 +1130,12 @@ proc getConfigDir*(): string {.rtl, extern: "nos$1".} =
   when defined(windows): return getEnv("APPDATA") & "\\"
   else: return getEnv("HOME") & "/.config/"
 
+proc getTempDir*(): string {.rtl, extern: "nos$1".} =
+  ## Returns the temporary directory of the current user for applications to
+  ## save temporary files in.
+  when defined(windows): return getEnv("TEMP") & "\\"
+  else: return "/tmp/"
+
 when defined(windows):
   # Since we support GUI applications with Nimrod, we sometimes generate
   # a WinMain entry proc. But a WinMain proc has no access to the parsed