Learn R Programming

syncdr (version 0.1.1)

copy_files_to_left: Copy files from right directory to left directory

Description

This function copies files from a right (source) directory to a left (destination) directory based on a provided data frame containing file paths and synchronization status.

Usage

copy_files_to_left(left_dir, right_dir, files_to_copy, recurse = TRUE)

Value

Invisible TRUE upon successful completion of the file copying process.

Arguments

left_dir

Path of the left (destination) directory.

right_dir

Path of the right (source) directory.

files_to_copy

Data frame containing paths of files to copy and their synchronization status.

recurse

Logical, default is TRUE.

  • If TRUE: Files are copied into corresponding subdirectories in the left directory. If a subdirectory doesn't exist in the left directory, it will be created.

  • If FALSE: Files are copied to the top level of the left directory.

Details

The function performs the following steps:

  1. Checks if the source (right) and destination (left) directories exist and creates the destination directory if it doesn't already exist.

  2. Copies files from the right directory to the corresponding subdirectory in the left directory based on the provided file paths.