Next: , Up: Persistence


42.1 database tmpfile

— Scheme Procedure: tmpfile

Return an input/output port to a unique temporary file named using the path prefix P_tmpdir defined in stdio.h. The file is automatically deleted when the port is closed or the program terminates.

The name of the temporary file associated with the returned port is not available to Scheme programs; (port-filename (tmpfile)) always returns the symbol tmpfile.

— Scheme Procedure: mkstemp base

Return a new port open on a temporary file named using string base. The actual assigned filename, available via procedure port-filename, is base appended with six random characters. For example:

          (define p (mkstemp "/tmp/foo-"))
          (port-filename p)
          ⇒ "/tmp/foo-hoQtxh"