explain_rmdir_or_die(3)

πŸ“¦
version 1.4.D001 Β· 2 versions
, in debian bookworm, debian trixie, ubuntu jammy, ubuntu noble, ubuntu resolute

✨ explain_rmdir_or_die(3) ✨

okay bestie, so this is a page from the Library Functions Manual and it's literally called explain_rmdir_or_die β€” yes the name is that dramatic, and yes it earns it. πŸ’…


πŸŽ€ NAME πŸŽ€

explain_rmdir_or_die β€” delete a directory and report errors

like. it deletes a directory. and if it can't? it reports the errors. hence the name. iykyk. πŸ’–


🌸 SYNOPSIS 🌸

#include <libexplain/rmdir.h>
void explain_rmdir_or_die(const char *pathname);

that's it. one include, one function, one pathname. no cap. ✨


πŸ¦‹ DESCRIPTION πŸ¦‹

so here's the vibe: explain_rmdir_or_die is the lil wrapper you call when you want to hit the rmdir(2) system call, but you also want ✨*drama*✨ when it goes wrong.

if it fails, an explanation gets printed to stderr β€” and that explanation comes straight from explain_rmdir(3) β€” and then the process just. ends. it terminates by calling exit(EXIT_FAILURE). no second chances, no "let me try again", just done. πŸ’€

the whole point is to use it in a fashion similar to this example right here:

explain_rmdir_or_die(pathname);

πŸ“ pathname

the pathname, exactly as to be passed to the rmdir(2) system call. no editing it, no remixing it, no adding your own lil twists. exactly as-is. periodt.

🌈 Returns:

this function only returns on success. that's the whole deal. if it fails, it prints an explanation and exits. there is no failure return value to check, because you will not be there to check it. 😭

bestie please note: this function does not come back on failure. it does not pass go. it does not collect $200. it calls exit(EXIT_FAILURE) and that's the end of your program's main character arc. 🫢

πŸ’œ SEE ALSO πŸ’œ

go read those too, they're iconic in their own right. πŸ‘‘


  • libexplain version 1.4
  • Copyright (C) 2008 Peter Miller

and that's the whole page bestie!! πŸŽ€ libexplain version 1.4, Copyright (C) 2008 Peter Miller, and this lil manual page signs off as explain_rmdir_or_die(3) β€” mwah, go delete some directories responsibly. πŸ’–βœ¨πŸ¦‹πŸŒΈπŸ’…

πŸ“¦ where this page comes from