Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

uiop:run-program with string output #61

Open
epipping opened this issue Nov 6, 2016 · 0 comments
Open

uiop:run-program with string output #61

epipping opened this issue Nov 6, 2016 · 0 comments

Comments

@epipping
Copy link

epipping commented Nov 6, 2016

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))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant