mirror of
https://git.in.rschanz.org/ryan77627/guix.git
synced 2024-12-26 14:28:15 -05:00
utils: Create temporary files in $TMPDIR or /tmp.
Reported by Federico Beffa <beffa@ieee.org>. * guix/utils.scm (call-with-temporary-output-file): Prepend $TMPDIR or /tmp to TEMPLATE.
This commit is contained in:
parent
e617a86137
commit
57db49cc3e
1 changed files with 3 additions and 2 deletions
|
@ -600,8 +600,9 @@ (define (call-with-temporary-output-file proc)
|
||||||
"Call PROC with a name of a temporary file and open output port to that
|
"Call PROC with a name of a temporary file and open output port to that
|
||||||
file; close the file and delete it when leaving the dynamic extent of this
|
file; close the file and delete it when leaving the dynamic extent of this
|
||||||
call."
|
call."
|
||||||
(let* ((template (string-copy "guix-file.XXXXXX"))
|
(let* ((directory (or (getenv "TMPDIR") "/tmp"))
|
||||||
(out (mkstemp! template)))
|
(template (string-append directory "/guix-file.XXXXXX"))
|
||||||
|
(out (mkstemp! template)))
|
||||||
(dynamic-wind
|
(dynamic-wind
|
||||||
(lambda ()
|
(lambda ()
|
||||||
#t)
|
#t)
|
||||||
|
|
Loading…
Reference in a new issue