- (run/port pf [redirection ...])syntax
- (run/file pf [redirection ...])syntax
- (run/string pf [redirection ...])syntax
- (run/strings pf [redirection ...])syntax
- (run/sexp pf [redirection ...])syntax
- (run/sexps pf [redirection ...])syntax
These forms are equivalent to run, except they wire up the current process to the endpoint of the pipeline, allowing you to read the standard output from the pipeline as a whole. If you also need standard error or have even more specialized needs, take a look at the run/collecting form.
The difference between these forms is in how this output is returned, and when the call returns:
- run/port immediately returns after forking, and returns a port from which you can read.
- run/file returns after the final process exits, resulting in a string which indicates a temporary file containing the process' output.
- run/string returns when the process closes its standard output (ie, when EOF is read), collecting the standard output into a string.
- run/strings is like run/string, but returns a list of strings, split at newline characters.
- run/sexp reads an s-expression, and returns as soon as a complete s-expression was read.
- run/sexps reads all s-expressions until eof, returning a list of s-expressions. It returns as soon as EOF is read.