Something went wrong while setting issue due date.
add make-fd-stream to the API
ECL has that functionality, but it isn't exported for the lisp world. For instance:
(defun make-input-stream-from-fd (name fd external-format)
(ffi:c-inline
(name fd external-format) (:string :int :object) :object
"ecl_make_stream_from_fd(#0, #1, ecl_smm_input, 8, ECL_STREAM_DEFAULT_FORMAT, #2)"
:one-liner t))
(defun make-output-stream-from-fd (name fd external-format)
(ffi:c-inline
(name fd external-format) (:string :int :object) :object
"ecl_make_stream_from_fd(#0, #1, ecl_smm_output, 8, ECL_STREAM_DEFAULT_FORMAT, #2)"
:one-liner t))
We want to mimic other interfaces, see how OSICAT uses them for other implementations. After implementing it run-program implementation from process.lsp has to use the new interface (instead of ffi based one) and osicat patch should be supplied.
OSICAT may want to use that, see fd-streams.lisp
:
#+(or sbcl cmu scl)
(pushnew :osicat-fd-streams *features*)
#+sbcl
(defun make-fd-stream (fd &key direction element-type external-format
pathname file)
(declare (ignore pathname file))
(let ((in-p (member direction '(:io :input)))
(out-p (member direction '(:io :output))))
(sb-sys:make-fd-stream fd :input in-p :output out-p
:element-type element-type
:external-format external-format)))
#+cmu
(defun make-fd-stream (fd &key direction element-type external-format
pathname file)
(declare (ignore external-format pathname file))
(let ((in-p (member direction '(:io :input)))
(out-p (member direction '(:io :output))))
(sys:make-fd-stream fd :input in-p :output out-p
:element-type element-type)))
#+scl
(defun make-fd-stream (fd &key direction element-type external-format
pathname file)
(let ((in-p (member direction '(:io :input)))
(out-p (member direction '(:io :output))))
(sys:make-fd-stream fd :input in-p :output out-p
:element-type element-type
:external-format external-format
:pathname pathname :file file)))