Common Lisp function or idiom for creating a temporary file name?
Asked Answered
B

3

10

Is there a Common Lisp function or typical way for creating a temporary file name or file?

Beagle answered 6/9, 2009 at 5:49 Comment(1)
Found this related link: bugs.launchpad.net/sbcl/+bug/393104Beagle
D
6

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.

Doubletree answered 27/11, 2014 at 16:35 Comment(1)
For my own project GSLL, I have just replaced Osicat with UIOP, because apparently the latter works better on Windows.Doubletree
C
3

There is no function for that in common lisp. Allegro has make-temp-file-name, Emacs has make-temp-file, clisp has mkstemp.

Coordination answered 6/9, 2009 at 6:14 Comment(0)
D
2

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.

Doubletree answered 19/8, 2011 at 12:54 Comment(2)
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.