utime.h(7POSIX)

πŸ’– utime.h(7POSIX) β€” the access & modification times header, bestie edition πŸ’–

okay so real talk: this is a page from the POSIX Programmer's Manual (yes, that's the manual name, 7POSIX section energy πŸ‘‘). And here's the tea:

Heads up! The Linux implementation of this interface may differ β€” go read the matching Linux manual page for the actual Linux behavior. Or, plot twist, the interface may not be implemented on Linux at all. 😭

🌸 PROLOG 🌸

This manual page is part of the POSIX Programmer's Manual. The Linux implementation of this interface may differ (consult the corresponding Linux manual page for details of Linux behavior), or the interface may not be implemented on Linux.


✨ NAME ✨

utime.h β€” access and modification times structure πŸ•°οΈπŸ’…


πŸ¦‹ SYNOPSIS πŸ¦‹

#include <utime.h>

πŸŽ€ DESCRIPTION πŸŽ€

So the <utime.h> header shall declare the utimbuf structure, and that struct shall include these members:

time_t    actime    Access time.
time_t    modtime   Modification time.

The times shall be measured in seconds since the Epoch. ⏳ no cap, that's the whole vibe of time here.

The <utime.h> header shall define the time_t type as described in <sys/types.h>. (go read that one, bestie, it's the source of truth ✨)

The following shall be declared as a function and may also be defined as a macro. A function prototype shall be provided:

int utime(const char *, const struct utimbuf *);

The following sections are informative. (translation: the vibes sections, not the rules sections 🫢)


πŸ’… APPLICATION USAGE πŸ’…

Lowkey important: the utime() function only allows setting file timestamps to the nearest second. That's it, that's the resolution. πŸ™ˆ

Applications should use the utimensat() function instead. See <sys/stat.h>. slay, upgrade your syscalls ⭐


🧚 RATIONALE 🧚

None. πŸ’€ literally none. iconic of them honestly.


🌈 FUTURE DIRECTIONS 🌈

The <utime.h> header may be removed in a future version. 🚨 not me warning you about deprecation, but yes, that's the warning. plan accordingly bestie.


πŸ’œ SEE ALSO πŸ’œ

  • <sys_stat.h>
  • <sys_types.h>
  • The System Interfaces volume of POSIX.1‐2017, futimens(), utime()

Portions of this text are reprinted and reproduced in electronic form from IEEE Std 1003.1-2017, Standard for Information Technology -- Portable Operating System Interface (POSIX), The Open Group Base Specifications Issue 7, 2018 Edition, Copyright (C) 2018 by the Institute of Electrical and Electronics Engineers, Inc and The Open Group. In the event of any discrepancy between this version and the original IEEE and The Open Group Standard, the original IEEE and The Open Group Standard is the referee document. The original Standard can be obtained online at http://www.opengroup.org/unix/online.html .

Any typographical or formatting errors that appear in this page are most likely to have been introduced during the conversion of the source files to man page format. To report such errors, see https://www.kernel.org/doc/man-pages/reporting_bugs.html .


and that's the whole page, bestie 🫢 brought to you by IEEE/The Open Group, dated 2017 β€” the year this standard said what it said and then dipped. ✨ mwah, go set some timestamps πŸ’–