From decd57bd3d4d30d4f6a4f1ec50f60261dce811f7 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Daniel=20Kochma=C5=84ski?= Date: Sun, 9 Aug 2015 11:38:01 +0200 Subject: [PATCH] doc: run-program: add limitations section MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Daniel Kochmański --- doc/ref_os.xmlf | 35 ++++++++++++++++++++++++----------- 1 file changed, 24 insertions(+), 11 deletions(-) diff --git a/doc/ref_os.xmlf b/doc/ref_os.xmlf index f35fa6a..b726cc2 100644 --- a/doc/ref_os.xmlf +++ b/doc/ref_os.xmlf @@ -362,9 +362,9 @@ ls [--help | -?] filename* error - One of :OUTPUT, T or - NIL, defaults to - T + One of :OUTPUT, :STREAM, + T or NIL, defaults to + :OUTPUT @@ -408,7 +408,8 @@ ls [--help | -?] filename* List all users in a Unix system. We use the sed command to parse the file with the list of users, removing comments and information other than the user names: -(defun all-users (&optional (file "/etc/passwd")) + +(defun all-users (&optional (file "/etc/passwd")) (let ((s (ext:run-program "sed" (list "-e" "/^#.*$/d;/^[^:]*$/d;s,^\\([^:]*\\).*$,\\1,g" file) @@ -417,19 +418,31 @@ ls [--help | -?] filename* (error "Unable to parse password file")) (loop for x = (read s NIL NIL) while x - collect x))) + collect x))) + Make a directory. Redirect standard error output to the same as the output: -(ext:run-program "mkdir" '("./tmp") :output :STREAM :error :OUTPUT) - - + (ext:run-program "mkdir" '("./tmp") :output :STREAM :error :OUTPUT) + + Same as before, but now both the output and the standard error are discarded -(ext:run-program "mkdir" '("./tmp") :output NIL :error :OUTPUT) - - + (ext:run-program "mkdir" '("./tmp") :output NIL :error :OUTPUT) + + + + + + Limitations + + All streams passed to ext:run-program has to have + underlying file handler. That means, that if gray streams are passed to + function - it might signal an error. Such situation might occur, for + instance, if output value is T and + *standard-output* is bound to gray stream (default if using + slime and emacs). -- 2.9.0