subprocess::file_descriptor class

Wraps a descriptor mapping to a file on the disc.

The class exports the open() syscall and is the parent class of ofile_descriptor and ifile_descriptor.

Base classes

class descriptor virtual
Abstracts file descriptors.

Derived classes

class ifile_descriptor virtual
Always opens the file in read-mode.
class ofile_descriptor virtual
Always opens the file in write-mode.

Constructors, destructors, conversion operators

file_descriptor(std::string path, int mode)
file_descriptor(const file_descriptor&) defaulted
file_descriptor(file_descriptor&&) defaulted noexcept
~file_descriptor() override

Public functions

auto operator=(const file_descriptor&) -> file_descriptor& defaulted
auto operator=(file_descriptor&&) -> file_descriptor& defaulted noexcept
void open() override
Initialize call before the process runs.

Function documentation

void subprocess::file_descriptor::open() override

Initialize call before the process runs.

open() is called by subprocess::execute() right before spawning the child process. This is the function to write for the set up of your I/O from the process.