(call-with-temp-file template proc [mode])
Runs a procedure on a temporary file.
proc
should be a
procedure of three values:
(path out preserve)
, where
path
is the path to the temporary file,
out
is
an output port opened on the file, and
preserve
is a
thunk to disable deleting the file. The file name will be in a
temp directory, based on
template
and having the same
extension if present, with permissions from the optional
mode
which defaults to
#o700
. Returns the result
of
proc
, after first deleting the file if the
preserve
thunk was not called.
(call-with-temp-dir template proc [mode])
Runs a procedure on a temporary directory.
proc
should be a
procedure of two values:
(path preserve)
, where
path
is the path to the temporary directory and
preserve
is a thunk to disable deleting the dir. The
directory name will be in a temp directory, based on
template
, with permissions from the optional
mode
which defaults to
#o700
. Returns the result of
proc
, after first deleting the file hierarchy rooted at
path
if the
preserve
thunk was not called.