mkdir: Create directories

Description Usage Arguments Details

Description

Create directories

Usage

1
mkdir(dirs, recursive = TRUE, verbose = TRUE)

Arguments

dirs

Character vector with paths of directories to be created

recursive

If TRUE then mkdir works like ‘mkdir -p’ in unix and makes parent directories as needed

verbose

If TRUE show a message for each newly created directory

Details

If a path in ‘dirs’ points to an existing directory, there is nothing left to do and the directory will just be ignored. If there is already a file that has the same name as the directory to be created, an error is thrown. Therefore mkdir only returns if every directory in ‘dirs’ either already exists or was successfully created. Failing early—instead of, for example, returning a logical vector indicating which of the directories in ‘dirs’ could be created—seems a desirable behavior since later code depending on the existence of the directories in ‘dirs’ would fail anyway: There is no need to start possibly long-running computations just to get an error when trying to write the precious results to a file in a non-existent directory.


cbaumbach/miscFun documentation built on May 13, 2019, 1:48 p.m.