R/mkdir.R

Defines functions mkdir

Documented in mkdir

#' Create Directory
#'
#' Create directory, including parent directories if necessary, without
#' generating a warning if the directory already exists.
#'
#' @param path a directory name.
#'
#' @return \code{TRUE} for success, \code{FALSE} for failure, invisibly.
#'
#' @seealso
#' \code{\link{dir.create}} is the base function to create a new directory.
#'
#' \code{\link{rmdir}} removes an empty directory.
#'
#' \code{\link{clean}} can be used to remove non-empty directories.
#'
#' \code{\link{TAF-package}} gives an overview of the package.
#'
#' @examples
#' \dontrun{
#' mkdir("emptydir")
#' rmdir("emptydir")
#'
#' mkdir("outer/inner")
#' rmdir("outer", recursive=TRUE)
#' }
#'
#' @export

mkdir <- function(path)
{
  out <- sapply(path, dir.create, showWarnings=FALSE, recursive=TRUE)
  invisible(out)
}

Try the TAF package in your browser

Any scripts or data that you put into this service are public.

TAF documentation built on March 31, 2023, 6:51 p.m.