- file-mkstemps TEMPLATE-FILENAME SUFFIX-LENGTHprocedure
Create a file based on the given TEMPLATE-FILENAME, in which the six characters before the suffix must be XXXXXX. These will be replaced with a string that makes the filename unique. SUFFIX-LENGTH should be a fixnum giving the length of the suffix in bytes. The file descriptor of the created file and the generated filename is returned. See the mkstemps(3) manual page for details on how this function works. The template string given is not modified.
Example usage:
(let ((suffix ".tmp")) (let-values (((fd temp-path) (file-mkstemps (string-append "/tmp/mytemporary.XXXXXX" suffix) (number-of-bytes suffix)))) (let ((temp-port (open-output-file* fd))) (format temp-port "This file is ~A.~%" temp-path) (close-output-port temp-port))))NOTE: On native Windows builds (all except cygwin), this procedure is unimplemented and will raise an error.