pipe_reader/writer/stream


pipe_reader(path, arguments = [], environment, directory, stdin_redirection = true,
            stdout_redirection = true, stderr_redirection, pseudo_terminal,
            show_console = true, transcoder)
pipe_writer(path, arguments = [], environment, directory, stdin_redirection = true, 
            stdout_redirection = true, stderr_redirection, pseudo_terminal,
            show_console = true, transcoder)      
pipe_stream(path, arguments = [], environment, directory, stdin_redirection = true, 
            stdout_redirection = true, stderr_redirection, pseudo_terminal, 
            show_console = true, transcoder)
      

Return a stream that can be used to communicate with an operating system process.

Path indicates the location of the executable program in the filesystem.

Direction should be one of the symbols 'input_output, 'input or 'output. Defaults to 'input_output.

Arguments a list of strings. Indicates the string arguments that are passed to the program. The default value of this setting is the empty list (i.e. no arguments).

Environment should be a list of strings. Indicates the set of environment variable bindings that the process receives. Each element of the list is a string of the form "VAR=VALUE", where VAR is the name of the variable and VALUE is its binding. When environment is false, the process inherits the environment variable bindings of its parent process. The default value of this setting is false.

Directory indicates the current working directory of the process. When directory is false, the process uses the value of current_directory(). The default value of this setting is false.

Stdin_redirection should be either true or false. Indicates how the standard input of the process is redirected. A setting of true will redirect the standard input from the pipe-stream (i.e. what is written to the pipe-stream will be available on the standard input). A setting of false will leave the standard input as-is, which typically results in input coming from the console. The default value of this setting is true.

Stdout_redirection should be either true or false. Indicates how the standard output of the process is redirected. A setting of true will redirect the standard output to the pipe-stream (i.e. all output to standard output can be read from the pipe-stream). A setting of false will leave the standard output as-is, which typically results in the output going to the console. The default value of this setting is true.

Stderr_redirection should be either true or false. Indicates how the standard error of the process is redirected. A setting of true will redirect the standard error to the pipe-stream (i.e. all output to standard error can be read from the pipe-stream). A setting of false will leave the standard error as-is, which typically results in error messages being output to the console. The default value of this setting is false.

Pseudo_terminal should be either true or false. This setting applies to UNIX. It indicates what type of device will be bound to the process' standard input and standard output. A setting of true will use a pseudo-terminal device (this is a device that behaves like a tty device even though there is no real terminal or user directly involved). A setting of false will use a pair of pipes. The difference is important for programs which behave differently when they are used interactively, for example shells. The default value of this setting is false

.

Show_console should be either true or false. It controls whether the process' console window will be hidden or visible. The default value of this setting is true (i.e. show the console window).

Transcoder, if present, must be a transcoder object, and this function returns a textual stream whose transcoder is transcoder.

Also see:

read_char
read_byte
write_char
write_byte
close_stream
pipe_process_pid
pipe_process_status


Core Module Index | Contents