fukamachi / woo

A fast non-blocking HTTP server on top of libev
http://ultra.wikia.com/wiki/Woo_(kaiju)
MIT License
1.28k stars 98 forks source link

uiop:run-program with string output #61

Open epipping opened 7 years ago

epipping commented 7 years ago

Hi,

I was looking at how different projects on quicklisp use uiop:run-program and came across this snippet in woo:

          (with-output-to-string (s)
            (uiop:run-program "uname -r"
                              :output s
                              :ignore-error-status t))))

I wanted to let you know that passing a stream as uiop:run-program's :output argument, especially one that isn't a file stream, is not very portable. But you can also get string output directly from uiop:run-program (that's far more portable because it internally uses a file) as follows:

(uiop:run-program '("uname" "-r") :output '(:string :stripped t))