Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

removeDirectory

Removes a directory


Description

Removes a directory, and if requested, also its contents.

Usage

## Default S3 method:
removeDirectory(path, recursive=FALSE, mustExist=TRUE, ...)

Arguments

path

A character string specifying the directory to be removed.

recursive

If TRUE, subdirectories and files are also removed. If FALSE, and directory is non-empty, an exception is thrown.

mustExist

If TRUE, and the directory does not exist, an exception is thrown.

...

Not used.

Value

Returns (invisibly) TRUE, the directory was successfully removed, otherwise FALSE, unless an exception is thrown.

Symbolic links

This function can also be used to remove symbolic links to directories without removing the target. Note that neither file.remove() nor unlink() is capable of remove symbolic directory links on Windows.

Author(s)

Henrik Bengtsson

See Also

Internally unlink() is used.


R.utils

Various Programming Utilities

v2.10.1
LGPL (>= 2.1)
Authors
Henrik Bengtsson [aut, cre, cph]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.