Skip to content

End of Life Ruby 3.2 has reached end of life and gets no more fixes. Switch to Ruby 4.0 →

class method

FileUtils.uptodate?

uptodate?(new, old_list)

Returns true if the file at path new is newer than all the files at paths in array old_list; false otherwise.

Argument new and the elements of old_list should be interpretable as paths:

Example
FileUtils.uptodate?('Rakefile', ['Gemfile', 'README.md']) # => true
FileUtils.uptodate?('Gemfile', ['Rakefile', 'README.md']) # => false

A non-existent file is considered to be infinitely old.

Related: FileUtils.touch.

See also #uptodate? .touch #cd .symlink also in 4.1 · 4.0 · 3.4 · 3.3 · 3.1 · 3.0