Method: FileUtils2#remove_entry

Defined in:
lib/fileutils2.rb

#remove_entry(path, force = false) ⇒ Object

This method removes a file system entry path. path might be a regular file, a directory, or something. If path is a directory, remove it recursively.

See also #remove_entry_secure.



849
850
851
852
853
854
855
856
857
858
859
# File 'lib/fileutils2.rb', line 849

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