Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

utime

Sets the access and modification timestamps of one or more files.

Takes an access time, a modification time (both as Unix epoch seconds, or undef for “now”), followed by a list of file paths. Each file’s timestamps are updated via the POSIX utimes(2) call. When Time::HiRes::utime is available, nanosecond precision is used via utimensat(2).

Passing undef for either timestamp sets it to the current time.

Returns the number of files successfully modified.

Synopsis

utime $atime, $mtime, @files;
utime undef, undef, @files;    # set to current time

See Also

stat, lstat