call-system-showing-output cmd &key current-directory prefix show-cmd output-stream wait => status
call-system-showing-output
is an extension to call-system
which allows output to be redirected. call-system-showing-output
therefore allows the user to, for example, invoke a command and redirect the output to the current Listener window.
If command is a string it is the command to execute. If it is a list, the first element of the list is the command and the remaining elements of the list are the command line arguments. The command is run directly, not via a subshell. If you need to invoke the command interpreter then pass as command "cmd /c command"
on NT or "command.com /c command"
on Windows 9x.
prefix is a prefix to be printed at the start of any output line. The default value is "; "
.
show-cmd specifies whether or not the cmd invoked will be printed as well as the output for that command. If t
then cmd will be printed. The default value for show-cmd is t
.
output-stream specifies where the output will be sent to. The default value is *standard-output*
.
If wait is true, call-system-showing-output
does not return until the process has exited. If nil
, call-system-showing-output
returns immediately and no output is shown. The default for wait is t
.
call-system-showing-output
returns the exit status of the process created.
CL-USER 223 > (sys:call-system-showing-output
"cmd /c type hello.txt"
:prefix "***")
***cmd /c type hello.txt
***Hi there
0
CL-USER 224 > (sys:s-showing-output
"cmd /c type hello.txt"
:prefix "&&&"
:show-cmd nil)
&&&Hi there
0