dir_safe_create: Create the elements of paths

Description Usage Arguments Value See Also

View source: R/Miscellaneous_Functions.R

Description

This is a wrapper for the function dir.create using different default settings and allowing multiple path names as input. The function checks if the provided paths may be valid names and catches any other errors with try.

Usage

1
dir_safe_create(paths, showWarnings = FALSE, recursive = TRUE, mode = "0777")

Arguments

paths

A list or vector of strings. Path names to be created.

showWarnings

logical; should the warnings on failure be shown?

recursive

logical. Should elements of the path other than the last be created? If true, like the Unix command mkdir -p.

mode

the mode to be used on Unix-alikes: it will be coerced by as.octmode. For Sys.chmod it is recycled along paths.

Value

An invisible list of length equal to the length of paths. The elements are NULL for invalid elements of paths, a logical value for the elements of paths with a successful calls to dir.create, or an object of class try-error for a failed call to dir.create.

See Also

dir.create


Burke-Lauenroth-Lab/SoilWat_R_Wrapper documentation built on Aug. 14, 2020, 5:17 p.m.