memesearch
Formatting a Drive with fmt

Formatting a Drive with fmt

Download Find similar pictures
Text on the meme
How to format a drive using {fmt}. #programmingtips #include <fmt/format.h> struct drive { std::string path; }; template <> struct fmt::formatter<drive> : fmt::formatter<int> { auto format(const drive& d, fmt::format_context& ctx) { auto command = fmt::format("sudo mkfs.ext4 {}", d.path); system(command.c_str()); return ctx.out(); } }; int main() { fmt::format("{}", drive("/dev/sda1")); }
What it means

A programming tips post shows C++ code that defines a custom {fmt} formatter for a drive. Formatting the drive secretly runs a sudo mkfs.ext4 command on /dev/sda1, which would erase and reformat the disk. The joke is a malicious or dangerously misleading code example disguised as a helpful formatting tutorial, suitable as a reaction to unsafe programming advice. EN: A programming tips post shows C++ code that defines a custom {fmt} formatter for a drive. Formatting the drive secretly runs a sudo mkfs.ext4 command on /dev/sda1, which would erase and reformat the disk. The joke is a malicious or dangerously misleading code example disguised as a helpful formatting tutorial, suitable as a reaction to unsafe programming advice.

Objects
Tags
Sources
Type
image
Size
696×800 · 65.9 KiB
Mood
саркастичный, опасный
Language
en
Added