Skip to content

Preview Ruby 4.1 is a preview. It can change before the final release. Switch to Ruby 4.0 →

instance method

FileUtils#remove_dir

(::FileUtils::path path, ?::boolish force) -> void
remove_dir(path, force = false)

Recursively removes the directory 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: methods for deleting.

See also .remove_dir #remove #remove_entry #pwd also in 4.0 · 3.4 · 3.3 · 3.2 · 3.1 · 3.0