Method: FileUtils.remove_entry

Defined in:
lib/fileutils.rb

.remove_entry(path, force = false) ⇒ Object

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.



1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
# File 'lib/fileutils.rb', line 1450

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