R/paths.R
ensure_dir.Rd
Creates path and its parents with fs::dir_create() when the folder does not exist yet. An existing folder is left alone.
path
fs::dir_create()
ensure_dir(path)
Folder to create.
path, invisibly.
out <- fs::path(tempfile(), "results", "qc") ensure_dir(out) fs::dir_exists(out) #> /tmp/RtmpacoIFD/file1a112331d7b1/results/qc #> TRUE unlink(fs::path_dir(fs::path_dir(out)), recursive = TRUE)