Skip to contents

Compares every unzipped file with the MD5 checksum ResearchBox lists for a file of the same name, and records every listed file that did not arrive or does not match. Files are matched by name, not by folder: the zip puts them in folders by type or by section, and the file list gives both, but the folder names are ResearchBox's own and could change.

Usage

.rbox_verify_downloads(rb_url, out_dir, listed, file_ids = "all")

Arguments

rb_url

the box's URL, for the failed table

out_dir

the folder the box was unzipped into

listed

the box's file table: from the zip's table of contents, or from the API (rbox_files() without rb_url); NULL when there is none (then nothing can be checked)

file_ids

the ids of the files that were asked for, or "all". Only these must arrive; every file that does arrive is checked, including a codebook ResearchBox added. An id that listed does not have (the table of contents lists only the files in the zip) did not arrive.

Value

a list with checksum_ok (a named logical vector, one per unzipped file, named by its path in out_dir; NA when no listed file has that name) and failed (a data frame with rb_url, name and error)