Changed default value of *temp-file-template*: First $TMPDIR is
consulted, if it is unset we use "/var/tmp".
This commit is contained in:
parent
5e3f793326
commit
d6a7f7c303
|
@ -175,7 +175,7 @@
|
|||
|
||||
;;; The thread-specific resource: A thread fluid
|
||||
|
||||
(define $resource 'emtpy-resource-value)
|
||||
(define $resource 'empty-resource-value)
|
||||
|
||||
(define (thread-read-resource) (thread-fluid $resource))
|
||||
(define (thread-set-resource! dir) (set-thread-fluid! $resource dir))
|
||||
|
@ -460,9 +460,22 @@
|
|||
(list (string-append (constant-format-string (car maybe-prefix))
|
||||
".~a"))))))
|
||||
|
||||
(define *temp-file-template*
|
||||
(make-fluid (string-append "/tmp/" (number->string (pid)) ".~a")))
|
||||
(define (initial-temp-file)
|
||||
(let ((tmpdir (getenv "TMPDIR")))
|
||||
(string-append
|
||||
(if tmpdir
|
||||
tmpdir
|
||||
"/var/tmp")
|
||||
"/"
|
||||
(number->string (pid))
|
||||
"~a")))
|
||||
|
||||
(define *temp-file-template* (make-fluid 'not-initialized-temp-file-template))
|
||||
|
||||
(define temp-file-reinitializer
|
||||
(make-reinitializer
|
||||
(lambda ()
|
||||
(set-fluid! *temp-file-template* (initial-temp-file)))))
|
||||
|
||||
(define (temp-file-iterate maker . maybe-template)
|
||||
(let ((template (:optional maybe-template (fluid *temp-file-template*))))
|
||||
|
|
Loading…
Reference in New Issue