This function copies files from a source directory (left_dir) to a destination directory (right_dir) based on a provided data frame containing file paths and synchronization status.
copy_files_to_right(left_dir, right_dir, files_to_copy, recurse = TRUE)Invisible TRUE upon successful completion of the file copying process.
Path of the source directory (left/leader).
Path of the destination directory (right/follower).
Data frame containing paths of files to copy and their synchronization status.
Logical, default is TRUE.
If TRUE: Files are copied into corresponding sub-directories in the destination folder. If a subdirectory doesn't exist in the destination, it will be created.
If FALSE: Files are copied to the top level of the destination directory.
The function performs the following steps:
Checks if the source and destination directories exist and creates the destination directory if it doesn't already exist.
Copies files from the source directory to the corresponding subdirectory in the destination directory based on the provided file paths.