explain_utimes_or_die(3)

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

πŸ’– explain_utimes_or_die(3) πŸ’–

okay bestie, gather round, because this is the libexplain glow-up of utimes(2) and she is serving error messages. This page lives in the Library Functions Manual section, and yes she's a real one. πŸŽ€


✨ NAME ✨

explain_utimes_or_die β€” change file access and modify times and report errors

like, she changes your file's access + modify times, and if it goes wrong she tells you, loudly, with receipts. πŸ’…


🌸 SYNOPSIS 🌸

#include <libexplain/utimes.h>
void explain_utimes_or_die(const char *pathname, const struct timeval *data);
int explain_utimes_on_error(const char *pathname, const struct timeval *data);

πŸ¦‹ DESCRIPTION πŸ¦‹

okay so there's two of them and they're sisters, not twins. πŸ‘―

The explain_utimes_or_die function is used to call the utimes(2) system call. On failure an explanation will be printed to stderr, obtained from the explain_utimes(3) function, and then the process terminates by calling exit(EXIT_FAILURE).

like. she does NOT do second chances. if it fails, the whole process is gone, bestie. main character exit. πŸ’€

The explain_utimes_on_error function is used to call the utimes(2) system call. On failure an explanation will be printed to stderr, obtained from the explain_utimes(3) function, but still returns to the caller.

she's the chill one. she tells you what happened and then she hands control right back to you like "your problem now, love u 🫢".

  • pathname β€” The pathname, exactly as to be passed to the utimes(2) system call. no edits, no vibes-based rewriting, pass it exactly.
  • data β€” The data, exactly as to be passed to the utimes(2) system call. same deal, verbatim, don't touch it.

⭐ RETURN VALUE ⭐

The explain_utimes_or_die function only returns on success, see utimes(2) for more information. On failure, prints an explanation and exits, it does not return.

not me emphasizing this again but fr fr: on failure she exits, she does not come back. there is no return. there is only the void. 😭

The explain_utimes_on_error function always returns the value return by the wrapped utimes(2) system call.

(yeah she always comes back. she's reliable like that. πŸ‘‘)


🌈 EXAMPLE 🌈

The explain_utimes_or_die function is intended to be used in a fashion similar to the following example:

explain_utimes_or_die(pathname, data);

that's it. that's the whole vibe. one line and you're done. iconic. ✨


πŸ’œ SEE ALSO πŸ’œ


libexplain version 1.4

Copyright (C) 2010 Peter Miller


okay that's the whole page bestie, go forth and fix your timestamps. πŸ’–βœ¨

signing off with the source + version + date energy: this is libexplain version 1.4, Copyright (C) 2010 Peter Miller, and the page footer is just the name explain_utimes_or_die(3) doing its little bow at the bottom. πŸ¦‹πŸŒΈπŸ’…

explain_utimes_or_die(3) β€” periodt. πŸ‘‘

πŸ“¦ where this page comes from