Raymond Toy pushed to branch issue-364-add-mkstemp-mkdtemp at cmucl / cmucl Commits: 9a9609a4 by Raymond Toy at 2025-01-08T09:34:19-08:00 Remove old version of unix-mkstemp Forgot to remove the previous version. - - - - - 1 changed file: - src/code/unix.lisp Changes: ===================================== src/code/unix.lisp ===================================== @@ -2901,32 +2901,6 @@ (function (* char)))) c-string)) -(defun unix-mkstemp (template) - _N"Generates a unique temporary file name from TEMPLATE, and creates - and opens the file. On success, the corresponding file descriptor - and name of the file is returned. - - The last six characters of the template must be \"XXXXXX\"." - ;; Hope this buffer is large enough! - (let ((octets (%name->file template))) - (unless (< (length octets) 8192) - (error "Internal buffer is too small for encoded file name of ~D octets" - (length octets))) - (with-alien ((buf (array c-call:unsigned-char 8192))) - ;; Convert the Lisp string and copy it to the alien buffer, being - ;; sure to zero-terminate the buffer. - (loop for k from 0 - for c across octets - do - (setf (deref buf k) (char-code c)) - finally (setf (deref buf k) 0)) - - (syscall ("mkstemp" (* c-call:unsigned-char)) - (values result - ;; Convert the file name back to a Lisp string. - (%file->name (cast buf c-call:c-string))) - (cast buf (* c-call:unsigned-char)))))) - (defun unix-mkstemp (template) _N"Generates a unique temporary file name from TEMPLATE, and creates and opens the file. On success, the corresponding file descriptor View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/commit/9a9609a42827ada69c2e083b... -- View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/commit/9a9609a42827ada69c2e083b... You're receiving this email because of your account on gitlab.common-lisp.net.