std::basic_filebuf::sync(3)
π std::basic_filebuf::sync π
okay so this page comes from the C++ Standard Libary manual β yes, that's literally how the manual name is spelled in the header, don't come for me π β and we're chatting about std::basic_filebuf::sync(3). Buckle up, bestie β¨
πΈ NAME πΈ
std::basic_filebuf::sync β std::basic_filebuf::sync
β¨ Synopsis β¨
protected:
virtual int sync()
If a put area exists (e.g. the file was opened for writing), it calls overflow() to write all pending output to the file, then flushes the file as if by calling std::fflush.
If a get area exists (e.g. the file was opened for reading), the effect is implementation-defined. A typical implementation may empty out the get area and move the current file position back by the corresponding number of bytes.
π Parameters π
(none)
Like, literally none. No parameters. Zero. Nada. π«Ά
π Return value π
0in case of success-1in case of failure
π¦ Notes π¦
sync() β or its equivalent β is implicitly called for output streams by close(), seekoff(), and seekpos(), and it's explicitly called by std::basic_streambuf::pubsync().
bestie, this is the βwho calls whomβ lore: output streams getsync()-ish behavior automatically fromclose(),seekoff(), andseekpos(), andstd::basic_streambuf::pubsync()calls it explicitly. iykyk π
π Example π
This section is incomplete.
Reason: no example.
Not me bringing you an empty example section π but that's literally what the page says. π
π₯ See also π₯
pubsyncβ invokessync()(public member function ofstd::basic_streambuf<CharT,Traits>)fflushβ synchronizes an output stream with the actual file (function)
π Category π
- Todo no example
source/version + date check, bestie: this cutie is from http://cppreference.com, version/date 2024.06.10, for std::basic_filebuf::sync(3). πβ¨
π¦ where this page comes from
- nixpkgs unstable: stdman 2024.07.05
- opensuse-leap 16.0: stdman 2024.07.05-bp160.1.9 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms