11.105 utime
¶
Removed in POSIX.1-2024.
POSIX.1-2017 specification:
https://pubs.opengroup.org/onlinepubs/9699919799/functions/utime.html
Gnulib module: utime
Portability problems fixed by Gnulib:
- The times that are set on the file are affected by the current time zone and
by the DST flag of the current time zone on some platforms:
mingw, MSVC 14 (when the environment variable
TZ
is set).
- On some platforms, the prototype for
utime
omits const
for the second argument:
mingw, MSVC 14.
- On some platforms,
utime("link-to-file/",buf)
succeeds instead
of failing with ENOTDIR
.
macOS 14.
Portability problems not fixed by Gnulib:
- On some platforms, this function mis-handles a trailing slash:
Solaris 9.
- This function cannot set full timestamp resolution.
Use
utimensat(AT_FDCWD,file,times,0)
,
or the gnulib module utimens
,
instead.
- This function sets a slightly different time stamp than the requested one:
Haiku.
- This function is removed in POSIX.1-2024.
You can use Gnulib module
utimens
instead.