FBB::TempStream(3bobcat)
π FBB::TempStream β the manual page, bestie edition π
okay so you found the bobcat man page for FBB::TempStream, section 3. She's a Temporary fstream and honestly? iconic. let's get into it π«Ά
β¨ NAME β¨
FBB::TempStream β a Temporary fstream. short name, big energy. π
πΈ SYNOPSIS πΈ
#include <bobcat/tempstream>
that's it. that's the whole vibe. include and go. β¨
π¦ DESCRIPTION π¦
so like, FBB::TempStream objects are temporary std::fstreams, opened with mode 0600 β as in, user-only read+write, nobody else gets to peek, main character privacy only. π
and here's the slay part: the file that a TempStream object creates gets removed from the file system the moment the TempStream object goes out of scope. auto-cleanup. it's giving responsible queen. no cap.
A TempStream object creates an empty file, and you can immediately insert information into the TempStream object. to switch between insertion and extraction, simply call seekg (for extraction) or seekp (for insertion). that's the whole trick, lowkey elegant.
under the hood, TempStream calls mkostemp(3) to construct the temporary file, which uses an extension of six characters beyond the base name that you specified as the argument to TempStream's constructor. six. characters. periodt. π
π NAMESPACE π
FBB
All constructors, members, operators and manipulators mentioned in this man-page are defined in the namespace FBB. so you already know what to type, bestie.
π INHERITS FROM π
std::fstream
she's literally descended from royalty. π
π CONSTRUCTORS π
TempStream(std::string const &base = "/tmp/FBB::TempStream")β The constructor initializes the object and creates a file with the given base-name, to which six random characters are appended. If theTempStreamcould not be constructed, anFBB::Exceptionis thrown. π
Copy and move constructors (and assignment operators) are not available. not up for grabs. do not attempt. π
π MEMBER FUNCTIONS π
All std::fstream members are available, as FBB::TempStream inherits from this class. (yes, all of them. the whole inheritance bag. π) In addition, TempStream itself offers:
std::string const &fileName() constβ The name of the created temporary file. π·οΈstd::string const &filename() constβ The name of the created temporary file. (same thing, different casing, both valid, we support both vibes. π )
β EXAMPLE β
#include <iostream>
#include <bobcat/tempstream>
using namespace std;
using namespace FBB;
int main()
{
TempStream ts("/tmp/demo");
ts << "Hello world\n";
ts.seekg(0);
string line;
getline(ts, line);
cout << line << ", removed: " << ts.fileName() << β\nβ;
}
look at her go. write, rewind with seekg(0), read it back, print the filename, and then poof β gone when she's done. πβ¨
π§ FILES π§
bobcat/tempstream β defines the class interface
π SEE ALSO π
π BUGS π
None reported. (iconic behaviour honestly, not a single complaint filed. π₯)
πΈ 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β. (a backronym that ate, fr fr. π«Ά)
π COPYRIGHT π
This is free software, distributed under the terms of the GNU General Public License (GPL). free as in freedom bestie, go wild but respect the license. β¨
π AUTHOR π
Frank B. Brokken (f.b.brokken@rug.nl). thank you king. π
and that's the whole page, bestie! this is libbobcat-dev_6.15.01, dated 2005-2026, and you just read FBB::TempStream(3bobcat). slay, stay safe, and remember to let your temp files go out of scope. π
π¦πΈ
π¦ 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