clean_dir: Empty a directory

View source: R/clean_dir.R

clean_dirR Documentation

Empty a directory

Description

Any files or directories in dir_to_clean are moved to the new directory dir_to_clean/old/moved_%Y%m%d_%H%M%S UNLESS THERE ARE MORE THAN max_files IN WHICH CASE ALL ARE DELETED

Usage

clean_dir(dir_to_clean, skip = "old", max_files = 10000)

Arguments

dir_to_clean

Path to directory to 'clean'

skip

Character. Any strings that identify files to skip (identified via base::grep())

max_files

Numeric. If there are more than max_files to be moved, files will be DELTETED instead of moved.

Value

Returns NULL. Any files in dir_to_clean are moved (or deleted). Log written to dirname(dir_to_clean)


Acanthiza/envFunc documentation built on Aug. 19, 2024, 4:50 a.m.