Permalink
Browse files

mktemp actually creates a new random filename before returning it

  • Loading branch information...
1 parent f311b38 commit df9fd21eeb8bda05e32d357c3715e93a1eb9918a @akkartik akkartik committed Apr 8, 2012
Showing with 4 additions and 1 deletion.
  1. +4 −1 arc.arc
View
@@ -906,7 +906,7 @@
(mac tofile (f . body)
(w/uniq (gf gs)
- `(let ,gs (+ ,f "." rand-string.6)
+ `(let ,gs (mktemp ,f)
(w/outfile ,gf ,gs
(w/stdout ,gf
,@body))
@@ -1718,6 +1718,9 @@
(def thread-rewind-receive args
(ac-niltree:$:thread-rewind-receive (ac-denil ,args)))
+(def mktemp((o prefix "arc"))
+ ($ (path->string (make-temporary-file (string-append prefix ".~a")))))
+
(mac trav (x . fs)
(w/uniq g
`((afn (,g)

0 comments on commit df9fd21

Please sign in to comment.