class method
FileUtils.remove_entry
(::FileUtils::path path, ?::boolish force) -> void
remove_entry(path, force = false)
lib/fileutils.rb
View on GitHub ↗
# File tmp/rubies/ruby-4.0.0/lib/fileutils.rb, line 1446
def remove_entry(path, force = false)
Entry_.new(path).postorder_traverse do |ent|
begin
ent.remove
rescue
raise unless force
end
end
rescue
raise unless force
end
Removes the entry given by path, which should be the entry for a regular file, a symbolic link, or a directory.
Argument path should be interpretable as a path.
Optional argument force specifies whether to ignore raised exceptions of StandardError and its descendants.
Related: FileUtils.remove_entry_secure.
See also
#remove_entry
.remove_dir
.remove_entry_secure
.remove
also in
4.1 · 3.4 · 3.3 · 3.2 · 3.1 · 3.0