Next: , Previous: Subprocesses, Up: Subprocesses


15.7.1 Subprocess Procedures

There are two commands for running synchronous subprocesses under Scheme. run-shell-command is very simple to use, provides access to all shell features, and is to be preferred in most situations. run-synchronous-subprocess allows direct execution of a program and precise control of the command-line arguments passed to the program, but does not provide file globbing, I/O redirection, or other shell features.

— procedure: run-shell-command command option ...

Runs command, which must be a string. Command is passed to a command shell for interpretation; how the shell is chosen is detailed below.

The options are a sequence of keyword/value pairs that specify optional behavior. See below for more information about options.

run-shell-command waits until the subprocess completes its execution and returns the exit code from the subprocess. If the subprocess is killed or stopped, an error is signalled and the procedure does not return.

— procedure: run-synchronous-subprocess program arguments option ...

Runs program, passing it the given command-line arguments. Program must be either the name of a program on the path, or else a pathname to a specific program. Arguments must be a list of strings; each string is a single command-line argument to the program.

The options are a sequence of keyword/value pairs that specify optional behavior. See below for more information about options.

run-synchronous-subprocess waits until the subprocess completes its execution and returns the exit code from the subprocess. If the subprocess is killed or stopped, an error is signalled and the procedure does not return.