FBB::Ce...tractor(3bobcat)
okay so bestie π welcome to FBB::CerrExtractor, straight out of the 3bobcat manual, where we execute child processes and read everything they scream into standard error. It's giving "middle management for fork/exec" and honestly? iconic. Sit down, grab a π, let's go.
β¨ NAME β¨
FBB::CerrExtractor β runs external programs writing standard error. π«Ά
β¨ SYNOPSIS β¨
#include <bobcat/cerrextractor>
Linking option: -lbobcat π
π DESCRIPTION π
Okay so the FBB::CerrExtractor class is a basic interface for calling external programs (aka child processes) that write to their standard error streams. Think of it as your lil handler for the chaotic stderr energy. π
By default, the child process's standard input and standard output streams are not handled by CerrExtractor objects. No cap. The child's standard error is what gets read through the CerrExtractor object: anything the child process writes to its standard error stream is extracted or read from that CerrExtractor object. That's the whole job. πΈ
β οΈ Big one: the PATH environment variable is not used when calling child processes. Child process programs have to be specified using paths. Yes, actual paths. The vibes do not locate your binary for you, bestie.
CerrExtractor objects may repeatedly be used to execute the same or different child processes β reuse era, we love a sustainable queen. β»οΈ
Now, the quoting rules, because this is where it gets β¨spicyβ¨:
- 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.,
\100is converted to@). π yes literally.
π NAMESPACE π
FBB
All constructors, members, operators and manipulators mentioned in this man-page are defined in the namespace FBB.
π¦ INHERITS FROM π¦
FBB::Exec (private), FBB::IFdBuf (private), std::istream
Three parents, one slay. π
β CONSTRUCTOR β
CerrExtractor(size_t bufSize = 100)β you may pass abufSizeargument: it defines the internal buffer size used by theCerrExtractor's streambuf. By default the standard input and standard output streams are not handled. πCerrExtractor(Mode mode, size_t bufSize = 100)β themodeargument must beCerrExtractor::CLOSE_STD. It indicates that the standard input and standard error streams are redirected to/dev/null: the child processes cannot read their standard input streams and any standard output generated by child processes is ignored. AbufSizeargument may be specified: it defines the internal buffer size used by theCinInserter's streambuf. π«§
π¨ Copy and move constructors (and assignment operators) are not available. Not negotiable, not coming back, no notes.
π MEMBERS π
void execute(std::string const &cmd)β the argument specifies the command to execute: the command itself must be specified using an absolute path (thePATHenvironment variable isn't used, reminder bestie π). This member immediately returns, after which information written by the child process to its standard error stream may be extracted from theCerrExtractorobject.
Once execute has returned it can be called again, either using the same or another command. Repeat offender behavior, but make it productive. β¨
Arguments passed to the program to be executed as child process may optionally be specified using single or double quotes, as described in this man-page's DESCRIPTION section. π
int ret() constβ onceexecutehas returned, this member provides the actual exit code of the child process. Its value equals-1before the firstexectuecall. (Yes, that's the spelling in the original, and no, we don't edit the original, we respect it. π)
π PROTECTED MEMBER π
Pipe &childOutPipe()β if derived classes need to override the redirections-members then they probabaly need access to the pipe written by the child process. This member provides a reference to that pipe. By default the parent process reads information from the pipe, while the child process inserts its standard error output into the pipe. π§
π§ EXAMPLE π§
#include <iostream>
#include <bobcat/cerrextractor>
using namespace std;
using namespace FBB;
int main()
{
CerrExtractor extractor;
extractor.execute("/bin/cat driver.cc");
cout << extractor.rdbuf();
cerr << "Returning: " << extractor.ret() << "\n"
"again:\n";
extractor.execute("/bin/cat driver.cc");
cout << extractor.rdbuf();
cerr << "Returning: " << extractor.ret() << β\nβ;
}
π FILES π
bobcat/cerrextractorβ provides the class interface
π SEE ALSO π
bobcat(7), cininserter(3bobcat), coutextractor(3bobcat), execl(3), exec(3bobcat), fork(3bobcat), process(3bobcat), stdextractor(3bobcat).
Go read the whole friend group, they're all connected. π«Ά
π BUGS π
None reported.
πΈ BOBCAT PROJECT FILES πΈ
- https://fbb-git.gitlab.io/bobcat/ β gitlab project page;
Debian Bobcat project files:
libbobcat6β debian package containing the shared library, changelog and copyright note;libbobcat-devβ debian package containing the static library, headers, manual pages, and developer info;
π BOBCAT π
Bobcat is an acronym of Brokkenβs Own Base Classes And Templates. π± the lore is real
π COPYRIGHT π
This is free software, distributed under the terms of the GNU General Public License (GPL). Free as in freedom, and free as in slay. π
π¦ AUTHOR π¦
Frank B. Brokken (f.b.brokken@rug.nl).
and that's the whole page bestie, no cap, we kept every single flag, path, exit code and footnote. ate and left no crumbs. π
signing off from libbobcat-dev_6.15.01 β copyright vibes spanning 2005-2026, FBB::Ce...tractor(3bobcat), the one and only. mwah π
π¦ where this page comes from
- ubuntu stonking: libbobcat-dev 6.15.01-1 Β· GPL-3.0-or-later WITH OpenSSL exception
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms