Skip to content

Maintenance Ruby 3.4 gets fixes, but no new features. Switch to Ruby 4.0 →

class method

FileUtils.safe_unlink

(::FileUtils::pathlist list, ?noop: ::boolish, ?verbose: ::boolish) -> void
safe_unlink(list, noop: nil, verbose: nil)

Alias of .rm_f

Equivalent to:

Example
FileUtils.rm(list, force: true, **kwargs)

Argument list (a single path or an array of paths) should be interpretable as paths.

See FileUtils.rm for keyword arguments.

Related: methods for deleting.

See also .rm_f #safe_unlink .rmtree .symlink also in 4.1 · 4.0 · 3.3 · 3.2 · 3.1 · 3.0