Unifying tmp files

This commit is contained in:
Jay McCarthy 2010-04-22 11:42:02 -06:00
parent 5119987409
commit b5d2496544
3 changed files with 7 additions and 2 deletions

View File

@ -50,7 +50,7 @@
(define props:get-prop
(hash-ref! props-cache rev
(lambda ()
(define tmp-file (make-temporary-file "props~a.ss"))
(define tmp-file (make-temporary-file "props~a.ss" #f (current-temporary-directory)))
(and
; Checkout the props file
(scm-export

View File

@ -1,6 +1,9 @@
#lang scheme
(require scheme/file)
(define current-temporary-directory
(make-parameter #f))
(define (directory-list->directory-list* l)
(sort (filter-not (compose
(lambda (s)
@ -41,6 +44,7 @@
(path->string pth-string)))
(provide/contract
[current-temporary-directory (parameter/c (or/c false/c path-string?))]
[safely-delete-directory (path-string? . -> . void)]
[directory-list->directory-list* ((listof path?) . -> . (listof path?))]
[directory-list* (path-string? . -> . (listof path?))]

View File

@ -230,7 +230,7 @@
(stop-job-queue! test-workers))
(define (make-fresh-home-dir)
(define new-dir (make-temporary-file "home~a" 'directory))
(define new-dir (make-temporary-file "home~a" 'directory (current-temporary-directory)))
(with-handlers ([exn:fail? void])
(copy-directory/files (hash-ref (current-env) "HOME") new-dir))
(path->string new-dir))
@ -263,6 +263,7 @@
(make-directory* tmp-dir)
; We are running inside of a test directory so that random files are stored there
(parameterize ([current-directory test-dir]
[current-temporary-directory tmp-dir]
[current-rev rev])
(with-env (["PLTSTDERR" "error"]
["TMPDIR" (path->string tmp-dir)]