Programming

(Racket) (system)

steloflute 2012. 9. 12. 23:30

http://docs.racket-lang.org/reference/subprocess.html?q=system&q=generator#(def._((lib._racket/system..rkt)._system))

 

 

(system command) boolean?

command : (or/c string-no-nuls? bytes-no-nuls?)

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

See also current-subprocess-custodian-mode and subprocess-group-enabled, which affect the subprocess used to implement system.

The resulting process writes to (current-output-port), reads from (current-input-port), and logs errors to (current-error-port). To gather the process’s non-error output to a string, for example, use with-output-to-string, which sets current-output-port while calling the given function:

(with-output-to-string (lambda () (system "date")))

 

'Programming' 카테고리의 다른 글

Using the XML HTTP Request object  (0) 2012.09.14
Clojure: The zombie-reanimated corpse of Lisp | imagine27  (0) 2012.09.14
(Scheme) call/cc  (0) 2012.09.11
(Haskell) Hello World  (0) 2012.09.10
(Racket) file->string  (0) 2012.09.09