Use proper utilities for temporary file handling

This commit is contained in:
retropikzel 2025-06-29 12:28:20 +03:00
parent 4dfdacf3ac
commit 16b771f4d2
3 changed files with 18 additions and 18 deletions

View file

@ -1399,15 +1399,14 @@
path
"/usr/local/share/guile/"))))
((mosh)
(with-output-to-file
(make-path (cond-expand (windows (get-environment-variable "TMP"))
(else "/tmp"))
"snowmosh")
(call-with-temp-file "snow-mosh.scm"
(lambda (tmp-path out preserve)
(with-output-to-file tmp-path
(lambda ()
(display "(import (scheme base) (scheme write) (mosh config))")
(newline)
(display "(display (get-config \"library-path\"))")))
(list (make-path (process->sexp '(mosh /tmp/snowmosh)) "lib")))
(list (make-path (process->string `(mosh ,tmp-path)) "lib")))))
((larceny)
(list
(make-path

View file

@ -41,15 +41,15 @@
'(kawa -e "(write (features))"))))
(mosh "mosh" (mosh -v) #f
,(delay
(let ((tmpfile (string-append (cond-expand (windows (get-environment-variable "TMP"))
(else "/tmp"))
"/snowmosh")))
(with-output-to-file
tmpfile
(call-with-temp-file "snow-mosh.scm"
(lambda (tmp-path out preserve)
(with-output-to-file tmp-path
(lambda ()
(display "(import (scheme base) (scheme write) (mosh config)) (display (features))")))
(display "(import (scheme base) (scheme write) (mosh config))")
(newline)
(display "(display (features))")))
(process->sexp
`(mosh ,tmpfile)))))
`(mosh ,tmp-path))))))
(larceny "larceny" (larceny --version) "v0.98"
,(delay '()))
(sagittarius "sagittarius" #f #f

View file

@ -20,6 +20,7 @@
(chibi pathname)
(chibi process)
(chibi string)
(chibi temp-file)
(chibi uri))
(cond-expand
(chibi (import (chibi io)))