diff --git a/doc/ref_os.xmlf b/doc/ref_os.xmlf index f35fa6af7..b726cc2b4 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).