( utimensat()) Too many symbolic links were encountered in resolving pathname.ĮNAMETOOLONG ( utimensat()) pathname is too long. Pathname is NULL, dirfd is not AT_FDCWD, and flags contains AT_SYMLINK_NOFOLLOW. Invalid value in one of the tv_nsec fields (value outside range 0 to 999,999,999, and not UTIME_NOW or UTIME_OMIT) or an invalid value Times pointed to an invalid address or, dirfd was AT_FDCWD, and pathname is NULL or an invalid address. ( utimensat()) pathname is a relative pathname, but dirfd is neither AT_FDCWD nor a valid file descriptor. ( futimens()) fd is not a valid file descriptor. The file is marked immutable (see chattr(1)). Privileged (Linux: does not have either the CAP_FOWNER or the CAP_DAC_OVERRIDE capability) or, The effective user ID of the caller does not match the owner of the file, the caller does not have write access to the file, and the caller is not Times is NULL, or both tv_nsec values are UTIME_NOW, and: On error, -1 is returned and errno is set to indicate the error. On success, utimensat() and futimens() return 0. The flags field is a bit mask that may be 0, or include the following constant, defined in :ĪT_SYMLINK_NOFOLLOW If pathname specifies a symbolic link, then update the timestamps of the link, rather than the file to which it refers. If pathname is absolute, then dirfd is ignored. If pathname is relative and dirfd is the special value AT_FDCWD, then pathname is interpreted relative to the current workingĭirectory of the calling process (like utimes(2)). Than relative to the current working directory of the calling process, as is done by utimes(2) for a relative pathname). Utimensat() specifics If pathname is relative, then by default it is interpreted relative to the directory referred to by the open file descriptor, dirfd (rather Modified, but other error conditions may still be detected. If both tv_nsec fields are specified as UTIME_OMIT, then no file ownership or permission checks are performed, and the file timestamps are not UTIME_NOW and both tv_nsec fields are not UTIME_OMIT), either condition 2 or 3 above must apply. To make any change other than setting both timestamps to the current time (i.e., times is not NULL, and both tv_nsec fields are not The caller must have appropriate privileges. The caller's effective user ID must match the owner of the file or The caller must have write access to the file Permissions requirements To set both file timestamps to the current time (i.e., times is NULL, or both tv_nsec fields specify UTIME_NOW), either: If times is NULL, then both timestamps are set to the current time. In both of these cases, the value of the corresponding tv_sec field is ignored. If the tv_nsec field of one of the timespec structures has the special value UTIME_OMIT, then the corresponding file If the tv_nsec field of one of the timespec structures has the special value UTIME_NOW, then the corresponding file timestamp is set to } Updated file timestamps are set to the greatest value supported by the file system that is not greater than the specified time. This information is conveyed in a structure of the following form: Each of the elements of times specifies a time as the number of seconds and Times specifies the new "last modification time" ( mtime). Is specified via an open file descriptor, fd.įor both calls, the new file timestamps are specified in the array times: times specifies the new "last access time" ( atime) With futimens() the file whose timestamps are to be updated With utimensat() the file is specified via the pathname given in pathname. Utimes(2), which permit only second and microsecond precision, respectively, when setting file timestamps. This contrasts with the historical utime(2) and Utimensat() and futimens() update the timestamps of a file with nanosecond precision. Int futimens(int fd, const struct timespec times ) įeature Test Macro Requirements for glibc (see feature_test_macros(7)): Int utimensat(int dirfd, const char * pathname ,Ĭonst struct timespec times, int flags ) Synopsis #include /* Definition of AT_* constants */ Utimensat, futimens - change file timestamps with nanosecond precision
0 Comments
Leave a Reply. |