This site is a static rendering of the Trac instance that was used by R7RS-WG1 for its work on R7RS-small (PDF), which was ratified in 2013. For more information, see Home. For a version of this page that may be more recent, see ProcessPortsCowan in WG2's repo for R7RS-large.

Process­Ports­Cowan

cowan
2012-04-11 01:41:56
3history
source

Process Ports

The procedures in this proposal start a new operating system process and return a binary port (remember, binary ports can do character I/O as well) connected to either the standard input (for an output port) or the standard output (for an input port) of the new process. There is no support for input/output process ports, though an implementation could add them as an extension.

This library depends on the acceptance of SettingsListsCowan.

Procedures

(open-input-process filename)

(open-output-process filename)

All of these are equivalent to the corresponding R5RS functions on file ports. If filename is a string, it is a shell command suitable for passing to shell-command. If it is a list, it is a settings list as described in PortsCowan. Implementations MUST support the following keys:

path
The system command to be executed.
arguments
A list of strings to be passed as the arguments of the command. If absent or (), no arguments are passed.
environment
An alist, mapping strings to strings, representing the environment variables to be passed to the new process and their values. If the same environment variable appears more than once, all occurrences except the first are ignored, as is usual when processing alists. If this key is absent, the current environment is passed. If this key is (), an empty environment is passed.
stdin-redirection
A string representing the file to open and pass to the new process as its standard input, or a port (it is an error if the port has no OS-level underpinnings). If this key is absent, no redirection is done.
stdout-redirection
A string representing the file to open and pass to the new process as its standard output, or a port (it is an error if the port has no OS-level underpinnings). If this key is absent, no redirection is done.
stderr-redirection
A string representing the file to open and pass to the new process as its standard error, or a port (it is an error if the port has no OS-level underpinnings). If this key is absent, no redirection is done.