Is there a Common Lisp function or typical way for creating a temporary file name or file?
Common Lisp function or idiom for creating a temporary file name?
Asked Answered
Found this related link: bugs.launchpad.net/sbcl/+bug/393104 –
Beagle
Update since a few years have passed. There are two systems that can open a temporary file not previously mentioned, cl-fad and UIOP. They are both in quicklisp, and UIOP is part of ASDF3, which comes with most CL implementations now.
For my own project GSLL, I have just replaced Osicat with UIOP, because apparently the latter works better on Windows. –
Doubletree
There is no function for that in common lisp. Allegro has make-temp-file-name, Emacs has make-temp-file, clisp has mkstemp.
See the Osicat function open-temporary-file and macro with-temporary-file. This only creates a file and returns a stream, it does not provide a pathname, so it will only work where a stream is sufficient. Osicat is in Quicklisp.
You can use pathname to get the pathname of a stream. –
Dithyramb
@billitch That is true, but I had in mind that the OP wanted to get a pathname without actually opening the file, given the phrasing of the question: "creating a temporary file name". –
Doubletree
© 2022 - 2024 — McMap. All rights reserved.