create_dirs

0th

Percentile

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 inside tempdir().
Value

A logical vector of successes of failures.

Note

create_dirs will only attempt to create directories that don't already exist.

See Also

dir.create, unlink

Aliases
  • create_dirs
  • create_files
  • remove_dirs
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")))

Documentation reproduced from package pathological, version 0.1-1, License: Unlimited

Community examples

Looks like there are no examples yet.