[#subprocess] = subprocess :mrdocs: Getting started with reading this source code. The source is mainly divided into four parts: 1. Exception Classes: These are very basic exception classes derived from runtime_error exception. There are two types of exception thrown from subprocess library: OSError and CalledProcessError == Description 2. Popen Class This is the main class the users will deal with. It provides with all the API's to deal with processes. 3. Util namespace It includes some helper functions to split/join a string, reading from file descriptors, waiting on a process, fcntl options on file descriptors etc. 4. Detail namespace This includes some metaprogramming and helper classes. == Namespaces [cols="1,4"] |=== | Name| Description | xref:subprocess/util.adoc[`util`] | Low‐level helpers shared by the subprocess implementation (argument quoting, pipes, descriptors). |=== == Types [cols="1,4"] |=== | Name| Description | xref:subprocess/Buffer.adoc[`Buffer`] | class: Buffer This class is a very thin wrapper around std::vector<char> This is basically used to determine the length of the actual data stored inside the dynamically resized vector. | xref:subprocess/CalledProcessError.adoc[`CalledProcessError`] | class: CalledProcessError Thrown when there was error executing the command. Check Popen class API's to know when this exception can be thrown. | xref:subprocess/OSError.adoc[`OSError`] | class: OSError Thrown when some system call fails to execute or give result. The exception message contains the name of the failed system call with the stringisized errno code. Check Popen class API's to know when this exception would be thrown. Its usual that the API exception specification would have this exception together with CalledProcessError. | xref:subprocess/Popen.adoc[`Popen`] | class: Popen This is the single most important class in the whole library and glues together all the helper classes to provide a common interface to the client. | xref:subprocess/error.adoc[`error`] | Option to specify the error channel for the child process. It can be: 1. An already open file descriptor. 2. A file name. 3. IOTYPE. Usually a PIPE or STDOUT | xref:subprocess/executable.adoc[`executable`] | Option to specify the executable name separately from the args sequence. In this case the cmd args must only contain the options required for this executable. | xref:subprocess/input.adoc[`input`] | Option to specify the input channel for the child process. It can be: 1. An already open file descriptor. 2. A file name. 3. IOTYPE. Usual a PIPE | xref:subprocess/output.adoc[`output`] | Option to specify the output channel for the child process. It can be: 1. An already open file descriptor. 2. A file name. 3. IOTYPE. Usually a PIPE. | xref:subprocess/string_arg.adoc[`string_arg`] | Base class for all arguments involving string value. |=== == Type Aliases [cols="1,4"] |=== | Name| Description | xref:subprocess/ErrBuffer.adoc[`ErrBuffer`] | Buffer holding the data captured from the child's error descriptor. | xref:subprocess/OutBuffer.adoc[`OutBuffer`] | Buffer holding the data captured from the child's output descriptor. |=== == Enums [cols="1,4"] |=== | Name| Description | xref:subprocess/IOTYPE.adoc[`IOTYPE`] | Used for redirecting input/output/error |=== == Variables [cols="1,4"] |=== | Name| Description | xref:subprocess/DEFAULT_BUF_CAP_BYTES.adoc[`DEFAULT_BUF_CAP_BYTES`] | Default buffer capacity for OutBuffer and ErrBuffer, in bytes. | xref:subprocess/SP_MAX_ERR_BUF_SIZ.adoc[`SP_MAX_ERR_BUF_SIZ`] | Maximum buffer size allocated on the stack when reading an error from a pipe. |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#