Next Prev Up Top Contents Index

call-system

Function
Package

system

Syntax

call-system comand &key current-directory wait => status

Arguments

command

A string or a list of strings.

current-directory

A string.

wait

A boolean.

Values

status

The exit status of the invoked process.

Description

call-system allows executables and DOS commands to be called from Lisp code. The output goes to standard output, as the operating system sees it. (This normally means *terminal-io* in LispWorks.)

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.

current-directory is the lpCurrentDirectory argument passed to CreateProcess. If this is not supplied, the pathname-location of the current-pathname is passed.

If wait is true, call-system does not return until the process has exited. The default for wait is nil .

call-system returns the exit status of the process created.

Example
CL-USER 176 > sys:call-system "sleep 3" :wait t
0
See Also

call-system-showing-output


LispWorks Reference Manual (Windows version) - 14 Dec 2001

Next Prev Up Top Contents Index