FREEBSD::FILE_UP(3)

πŸ“¦ version 15.1, in freebsd 15.1

🌸 NAME 🌸

okay so this is the FREEBSD::FILE_UP(3) page, bestie β€” and it's literally about freebsd::FILE_up, the std::unique_ptr specialization for stdio FILE objects. No cap, that's the whole name vibe. πŸ’…


πŸ“š LIBRARY πŸ“š

library β€œlibutil++” β€” yep, that's the one, bestie. 🫢


✨ SYNOPSIS ✨

#include <libutil++.hh>

using FILE_up = std::unique_ptr<FILE, fclose_deleter>;

πŸ’– DESCRIPTION πŸ’–

This class is a specialization of std::unique_ptr for stdio FILE objects. Iconic behavior, honestly. ✨

When a FILE object managed by an instance of this class is disposed, fclose(3) is invoked to dispose of the FILE object. That's it. That's the slay. πŸŽ€


πŸ§ͺ EXAMPLES πŸ§ͺ

             freebsd::FILE_up fp(fopen("foo.txt", "w"));
             if (!fp)
                     err(1, "fopen");
             fprintf(fp.get(), "hello0);
             // `fp' is implicitly closed on destruction

πŸ”₯ SEE ALSO πŸ”₯


Cute sign-off time, bestie: this one comes from Debian, dated July 31, 2025 β€” source/version and date, all accounted for, periodt. πŸ’œπŸ¦‹

πŸ“¦ where this page comes from
  • freebsd 15.1: base 15.1
  • πŸ“œ the page's license: BSD-2-Clause
  • πŸ’– girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms