On Tue, 03 Jul 2007 00:05:12 +0000, Sergey Kolos wrote:
When compile string is called with sbcl, slime creates a temporary file in (user folder folder) (c:\ under windows). However it probably should be in tmp folder. (In particular on my windows machine I don't have permission to write to c:\ folder, so this compilation procedure fails).
With this patch, if TEMP environment variable is defined, temporary files are created in folder specified by TEMP environment variable.
Even so it's not part of the POSIX standard i'd suggest to stick to the longstanding convention of using 'TMPDIR' as the name of the environment variable to specify the prefered location for temporary files.But isn't there a windows API call 'getTemp'?
Cheers, Ralf Mattes
Here is patch:
Index: swank-sbcl.lisp =================================================================== --- swank-sbcl.lisp (revision 54) +++ swank-sbcl.lisp (working copy) @@ -411,11 +411,14 @@ (sb-alien:define-alien-routine "tmpnam" sb-alien:c-string (dest (* sb-alien:c-string)))
+(defparameter *temp-folder* (sb-posix:getenv "TEMP")) + (defun temp-file-name () "Return a temporary file name to compile strings into."
- (concatenate 'string (tmpnam nil) ".lisp")) + (concatenate 'string
*temp-folder* (tmpnam nil) ".lisp"))