1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77
|
includefile(include/header)
COMMENT(manpage, section, releasedate, archive, short name)
manpage(FBB::Exec)(3bobcat)(_CurYrs_)(libbobcat-dev__CurVers_)
(Executing Child Processes)
manpagename(FBB::Exec)(Runs external programs)
manpagesynopsis()
bf(#include <bobcat/exec>)nl()
Linking option: tt(-lbobcat)
manpagedescription()
The bf(FBB::Exec) class offers a basic interface for calling external
programs (so-called em(child processes)). The standard streams of the child
processes are not handled by tt(Exec) objects: the parent's standard streams
are used by the child process. The tt(PATH) environment variable is not used
when calling child processes: child process programs must be specified using
paths.
tt(Exec) objects may repeatedly be used to execute the same or different
child processes. Before starting the next child process, the current child
process must have finished.
Arguments passed to child processes may be surrounded by double or single
quotes. Arguments surrounded by double quotes have their double quotes
removed, while interpreting any escape-sequences that may have been used
within. Arguments surrounded by single quotes have their single quotes
removed, while accepting their content as-is. In addition unquoted
escape-sequences may be specified: those escape sequences are evaluated and
replaced by their intended characters (e.g., tt(\100) is converted to tt(@)).
includefile(include/namespace)
manpagesection(INHERITS FROM)
bf(FBB::Fork)
manpagesection(CONSTRUCTOR)
Only the default constructor is supported.
manpagesection(MEMBERS)
itemization(
itb(bool execute(std::string const &cmd))
The argument specifies the command to execute: the command itself must
be specified as a path (the tt(PATH) environment variable isn't used). The
member returns tt(true) if the child process's exit value equals 0. Otherwise
tt(false) is returned. Once tt(execute) has returned it can be called again,
either using the same or another command. The class tt(Exec) does not offer
facilities to forcefully terminate child processes: parent processes are
suspended until the child processes have completed. Arguments passed to the
program to be executed as child process may optionall be specified using
single or double quotes, as described in this man-page's DESCRIPTION section.
itb(int ret() const)
Once tt(execute) has returned this member provides the actual exit
code of the child process. Its value equals -1 before the first tt(exectue)
call.
)
manpagesection(EXAMPLE)
verbinclude(../../exec/driver/driver.cc)
manpagefiles()
em(bobcat/exec) - provides the class interface
manpageseealso()
bf(bobcat)(7), bf(cerrextractor)(3bobcat), bf(cininserter)(3bobcat),
bf(coutextractor)(3bobcat), bf(execl)(3), bf(fork)(3bobcat),
bf(process)(3bobcat), bf(stdextractor)(3bobcat).
manpagebugs()
None reported.
includefile(include/trailer)
|