rmdir: Remove Empty Directory

Description Usage Arguments Value Note See Also Examples

View source: R/rmdir.R

Description

Remove empty directory under any operating system.

Usage

1
rmdir(path, recursive = FALSE)

Arguments

path

a directory name.

recursive

whether to remove empty subdirectories as well.

Value

TRUE for success, FALSE for failure, invisibly.

Note

The base function unlink(dir, recursive=FALSE) does not remove empty directories in Windows and unlink(dir, recursive=TRUE) removes non-empty directories, making it unsuitable for tidying up empty ones.

See Also

unlink with recursive = TRUE removes non-empty directories.

mkdir creates a new directory.

clean can be used to remove non-empty directories.

TAF-package gives an overview of the package.

Examples

1
2
3
4
5
6
7
8
## Not run: 
mkdir("emptydir")
rmdir("emptydir")

mkdir("outer/inner")
rmdir("outer", recursive=TRUE)

## End(Not run)

TAF documentation built on April 7, 2021, 5:06 p.m.