

Or an invalid value in one of the tv_sec fields.ĮINVAL pathname is NULL, dirfd is not AT_FDCWD, and flagsĮLOOP ( utimensat()) Too many symbolic links were encountered inĮNOENT ( utimensat()) A component of pathname does not refer to anĮxisting directory or file, or pathname is an empty Range 0 to 999,999,999, and not UTIME_NOW or UTIME_OMIT) Not have either the CAP_FOWNER or the CAP_DAC_OVERRIDEĮBADF ( futimens()) fd is not a valid file descriptor.ĮBADF ( utimensat()) pathname is relative but dirfd is neitherĮFAULT times pointed to an invalid address or, dirfd wasĪT_FDCWD, and pathname is NULL or an invalid address.ĮINVAL Invalid value in one of the tv_nsec fields (value outside To the file, and the caller is not privileged (Linux: does Owner of the file, the caller does not have write access The effective user ID of the caller does not match the Returned and errno is set to indicate the error.ĮRRORS top EACCES times is NULL, or both tv_nsec values are UTIME_NOW, and On success, utimensat() and futimens() return 0. Timestamps of the link, rather than the file to which it
UTIME SCRIPTFODDER UPDATE
If pathname specifies a symbolic link, then update the The flags field is a bit mask that may be 0, or include the If pathname is absolute, then dirfd is ignored. Then pathname is interpreted relative to the current workingĭirectory of the calling process (like utimes(2)). If pathname is relative and dirfd is the special value AT_FDCWD, See openat(2) for an explanation of why this Relative to the directory referred to by the open fileĭescriptor, dirfd (rather than relative to the current workingĭirectory of the calling process, as is done by utimes(2) for a If pathname is relative, then by default it is interpreted Timestamps are not modified, but other error conditions may still Ownership or permission checks are performed, and the file If both tv_nsec fields are specified as UTIME_OMIT, then no file Is UTIME_NOW and neither tv_nsec field is UTIME_OMIT), either To make any change other than setting both timestamps to theĬurrent time (i.e., times is not NULL, and neither tv_nsec field the caller must have appropriate privileges. the caller's effective user ID must match the owner of theģ. the caller must have write access to the file Ģ. NULL, or both tv_nsec fields specify UTIME_NOW), either:ġ. To set both file timestamps to the current time (i.e., times is If times is NULL, then both timestamps are set to the current In both of theseĬases, the value of the corresponding tv_sec field is ignored. Timespec structures has the special value UTIME_OMIT, then theĬorresponding file timestamp is left unchanged.

Special value UTIME_NOW, then the corresponding file timestamp is If the tv_nsec field of one of the timespec structures has the Updated file timestamps are set to the greatest value supportedīy the filesystem that is not greater than the specified time. Number of seconds and nanoseconds since the Epoch, Ġ0:00:00 +0000 (UTC). Each of the elements of times specifies a time as the ( atime) times specifies the new "last modification time" Updated is specified via an open file descriptor, fd.įor both calls, the new file timestamps are specified in theĪrray times: times specifies the new "last access time"

With futimens() the file whose timestamps are to be With utimensat() the file is specified via the pathname given in Precision, respectively, when setting file timestamps. Utime(2) and utimes(2), which permit only second and microsecond #include int utimensat(int dirfd, const char * pathname, const struct timespec times, int flags ) int futimens(int fd, const struct timespec times ) įeature Test Macro Requirements for glibc (seeĭESCRIPTION top utimensat() and futimens() update the timestamps of a file with SYNOPSIS top #include /* Definition of AT_* constants */ Utimensat, futimens - change file timestamps with nanosecond
UTIME SCRIPTFODDER MANUAL
UTIMENSAT(2) Linux Programmer's Manual UTIMENSAT(2) NAME top
