| 1 |
|
| 2 |
renv_robocopy_exec <- function(source, target, flags = NULL) { |
| 3 |
|
| 4 |
source <- path.expand(source) |
| 5 |
target <- path.expand(target) |
| 6 |
|
| 7 |
# add other flags |
| 8 |
flags <- c(flags, "/E", "/Z", "/R:5", "/W:10") |
| 9 |
|
| 10 |
# https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/robocopy |
| 11 |
# > Any value greater than 8 indicates that there was at least one failure |
| 12 |
# > during the copy operation. |
| 13 |
renv_system_exec( |
| 14 |
command = "robocopy", |
| 15 |
args = c(flags, renv_shell_path(source), renv_shell_path(target)), |
| 16 |
action = "copying directory", |
| 17 |
success = 0:7, |
| 18 |
quiet = TRUE |
| 19 |
) |
| 20 |
|
| 21 |
} |
| 22 |
|
| 23 |
renv_robocopy_copy <- function(source, target) { |
| 24 |
renv_robocopy_exec(source, target) |
| 25 |
} |
| 26 |
|
| 27 |
renv_robocopy_move <- function(source, target) { |
| 28 |
renv_robocopy_exec(source, target, "/MOVE") |
| 29 |
} |