chickadee » chicken » file » create-temporary-file

create-temporary-file #!optional EXTENSIONprocedure

Creates an empty temporary file and returns its pathname. If EXTENSION is not given, then .tmp is used. If the environment variable TMPDIR, TEMP or TMP is set, then the pathname names a file in that directory. If none of the environment variables is given, the location of the temporary file defaults to /tmp.

Note that TMPDIR, TEMP and TMP are checked in this order. It means that, for example, if both TMPDIR and TEMP are set, the value of TMPDIR will be used.

Changed in CHICKEN 5.4.0: the values of the TMPDIR, TEMP and TMP environment variables are no longer memoized (see https://bugs.call-cc.org/ticket/1830).