Skip to content

Maintenance Ruby 3.4 gets fixes, but no new features. Switch to Ruby 4.0 →

class method

File.utime

(::Time | ::Numeric atime, ::Time | ::Numeric mtime, *::string | ::_ToPath file_name) -> ::Integer
File.utime(atime, mtime, file_name, ...) → integer

Sets the access and modification times of each named file to the first two arguments. If a file is a symlink, this method acts upon its referent rather than the link itself; for the inverse behavior see File.lutime. Returns the number of file names in the argument list.

See also .unlink .world_readable? .umask .world_writable? also in 4.1 · 4.0 · 3.3 · 3.2 · 3.1 · 3.0