powered by
This function uses the mc command to remove files or directories at the specified target location.
mc
mc_rm(target, recursive = FALSE, flags = "", verbose = FALSE)
Returns the list from processx::run(), with components status, stdout, stderr, and timeout; invisibly.
processx::run()
status
stdout
stderr
timeout
Character string specifying the target file or directory path to be removed.
Logical indicating whether to recursively remove directories. Default is FALSE.
FALSE
Additional flags to be passed to the rm command. Default is an empty string.
rm
Logical indicating whether to list files removed. Default is FALSE.
see mc("rm -h") for details.
mc("rm -h")
if (FALSE) { # interactive() # Remove a file mc_rm("path/to/file.txt") # Remove a directory recursively mc_rm("path/to/directory", recursive = TRUE) }
Run the code above in your browser using DataLab