about summary refs log tree commit diff stats
path: root/src/extern/tempfile.nim
diff options
context:
space:
mode:
Diffstat (limited to 'src/extern/tempfile.nim')
-rw-r--r--src/extern/tempfile.nim18
1 files changed, 0 insertions, 18 deletions
diff --git a/src/extern/tempfile.nim b/src/extern/tempfile.nim
deleted file mode 100644
index 5968270b..00000000
--- a/src/extern/tempfile.nim
+++ /dev/null
@@ -1,18 +0,0 @@
-import std/os
-
-var tmpf_seq: int
-proc getTempFile*(tmpdir: string, ext = ""): string =
-  if not dirExists(tmpdir):
-    createDir(tmpdir)
-  var tmpf = tmpdir / "chatmp" & $getCurrentProcessId() & "-" & $tmpf_seq
-  if ext != "":
-    tmpf &= "."
-    tmpf &= ext
-  while fileExists(tmpf):
-    inc tmpf_seq
-    tmpf = tmpdir / "chatmp" & $tmpf_seq
-    if ext != "":
-      tmpf &= "."
-      tmpf &= ext
-  inc tmpf_seq
-  return tmpf