Skip to content

Commit

Permalink
Adds note about `system*' output.
Browse files Browse the repository at this point in the history
(Slightly revised by Eli.)
  • Loading branch information
elibarzilay committed May 9, 2012
1 parent 267a009 commit f1a7517
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions collects/scribblings/reference/subprocess.scrbl
Original file line number Diff line number Diff line change
Expand Up @@ -320,22 +320,23 @@ real process ID).}

Executes a Unix, Mac OS X, or Windows shell command synchronously
(i.e., the call to @racket[system] does not return until the
subprocess has ended). The @racket[command] argument is a string
or byte string containing no nul characters. If the command succeeds, the return
value is @racket[#t], @racket[#f] otherwise.
subprocess has ended). The @racket[command] argument is a string or
byte string containing no nul characters. If the command succeeds, the
return value is @racket[#t], @racket[#f] otherwise.

See also @racket[current-subprocess-custodian-mode] and
@racket[subprocess-group-enabled], which affect the subprocess used to
implement @racket[system].}
implement @racket[system].

The resulting process writes to @racket[(current-output-port)], reads from
@racket[(current-input-port)], and logs errors to @racket[(current-error-port)].
This means that processes show output to the screen and read from the keyboard by default.
If you just want to gather the process's output to a string, for example, use:
The resulting process writes to @racket[(current-output-port)], reads
from @racket[(current-input-port)], and logs errors to
@racket[(current-error-port)]. This means that processes usually
interact with the user like regular code. If you just want to gather
the process's output to a string, for example, use:

@racketblock[
(with-output-to-string (lambda () (system "date")))
]
]}


@defproc*[([(system* [command path-string?] [arg (or/c path? string? bytes?)] ...) boolean?]
Expand Down

0 comments on commit f1a7517

Please sign in to comment.