These functions take a path to a local directory, and a box.com folder id, and perform sychronization operations.

box_fetch downloads the contents of a box.com folder to a local directory.

box_push uploads the contents of local directory to a box.com folder.

Files which are present in the origin but not the destination will be copied over.

Behaviour when a file exists in both depends on the parameters described below.

box_fetch(dir_id = box_getwd(), local_dir = getwd(),
  recursive = TRUE, overwrite = FALSE, delete = FALSE)

box_push(dir_id = box_getwd(), local_dir = getwd(),
  ignore_dots = TRUE, overwrite = FALSE, delete = FALSE)

Arguments

dir_id

The id for the box.com folder

local_dir

The path to the local directory

recursive

logical. Should the call include subdirectories and thier contents?

overwrite

Where the same files exist in both the origin and the destination, and the files in the origin are newer, should the files in the destination be updated (overwritten)?

delete

logical. Should files which exist in the destination, but not the origin, be deleted?

ignore_dots

logical. Should local directories with filenames begining with dots be ignored? This is useful for 'invisible' folders such as .git and .Rproj.user where uploading them may be unexpected.

Value

An object of class boxr_dir_wide_operation_result, describing the file operations performed

Details

Overwrite/Update In the interests of preventing mishaps, overwrite is by default set to FALSE, which means that files which exist in the destination, but which are out of date, are not modified.

Setting overwrite to TRUE is likely to produce expected behavior for most users.

This is a conservative precaution to prevent users unexpectedly overwriting their files, and may change as a default in later releases.

However, files which are updated on box.com are versioned, and most operating systems have file recovery features (e.g. 'Trash' (Ubuntu/Debian/OSX), or 'Recycle Bin' (Windows)), so unintended modification of files will be revertable for most users.

Implementation At the time of writing, the box.com API only allows for one file at a time to be uploaded/downloaded, and as a result, boxr recursively scans the directory tree, uploading/downloading files in loops. Because the box.com API can send, but not accept, gzipped files, downloading tends to be faster than uploading.

box_fetch()/`box_push()`` rely on the internal function box_dir_diff() to determine how to process individual files (e.g. which to update, which to leave as is, etc.). See it's help page for details.

See also

box_dl()/box_ul() for single file operations. box_dir_diff() is the internal function which determines how files should be processed.