create_dirs
From pathological v0.1-1
by Richard Cotton
Create or remove files and directories
A vectorized version of dir.create
, and
file.create
and unlink
with more
convenient defaults.
Usage
create_dirs(x = temp_file(pattern = "dir"))
create_files(x = temp_file())
remove_dirs(x)
Arguments
- x
- A character vector of paths of directories to create/remove.
For
create_dirs
, it defaults to a directory insidetempdir()
.
Value
-
A logical vector of successes of failures.
Note
create_dirs
will only attempt to create directories that don't
already exist.
See Also
Examples
dirs <- temp_dir(c("foo", "bar/baz"))
create_dirs(dirs)
# Check this worked:
assertive.files::assert_all_are_dirs(dirs)
files <- temp_dir("blah/blah/blah", LETTERS)
create_files(files)
assertive.files::assert_all_are_existing_files(files)
# Clean up
remove_dirs(temp_dir(c("foo", "bar", "blah")))
Community examples
Looks like there are no examples yet.