Maintenance Ruby 3.4 gets fixes, but no new features. Switch to Ruby 4.0 →
class method
FileUtils.remove_file
(::FileUtils::path path, ?::boolish force) -> void
remove_file(path, force = false)
lib/fileutils.rb
View on GitHub ↗
# File tmp/rubies/ruby-3.4.1/lib/fileutils.rb, line 1474
def remove_file(path, force = false)
Entry_.new(path).remove_file
rescue
raise unless force
end
Removes the file entry given by path, which should be the entry for a regular file or a symbolic link.
Argument path should be interpretable as a path.
Optional argument force specifies whether to ignore raised exceptions of StandardError and its descendants.
Related: methods for deleting.
See also
#remove_file
.remove_entry_secure
.rm
.remove_entry
also in
4.1 · 4.0 · 3.3 · 3.2 · 3.1 · 3.0