process
popen
starts a system command and opens a pipe to or from it
Calling Sequence
Parameters
Description
popen(command, mode)
command
-
command line to invoke to start the process
mode
one of READ or WRITE
Important: The process package has been deprecated. Use the superseding package Threads instead.
The popen function starts the specified command, and connects a pipe to the command's standard input (WRITE) or standard output (READ). A file descriptor for the other end of the pipe is returned.
If the process was started in mode READ, the standard output of the process becomes available for reading on the returned descriptor. Any of the reading functions (for example, readline, readbytes, and fscanf) can be used.
If the process was started in mode WRITE, data written on the returned descriptor is piped to the standard input of the process. Any of the writing functions (for example, writeline, writebytes, and fprintf) can be used.
A pipe created by popen cannot be used by the block function.
The popen function is supported only on those platforms which provide operating system support for pipes and processes (for example, UNIX).
The command with(process,popen) allows the use of the abbreviated form of this command.
See Also
file_types
IO_errors
process/pclose
Threads
Download Help Document