Skip to content

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

class method

File.ctime

(::string | ::_ToPath | ::IO file_name) -> ::Time
File.ctime(file_name) → time

Returns the change time for the named file (the time at which directory information about the file was changed, not the file itself).

file_name can be an IO object.

Note that on Windows (NTFS), returns creation time (birth time).

Example
File.ctime("testfile")   #=> Wed Apr 09 08:53:13 CDT 2003
See also #ctime .chown .delete .chmod also in 4.1 · 4.0 · 3.3 · 3.2 · 3.1 · 3.0