testFile: Test files for validity.

View source: R/testFile.R

testFileR Documentation

Test files for validity.

Description

Sometimes users send shared links to folders before all files have sync'd, so these files might not be valid when downloaded.

Usage

testFile(files, tests = 1:4)

Arguments

files

vector of paths of files to check

tests

integer vector of tests to try; must be a subset of 1:4. Alternatively, this can be a list, in which case element tests[[i]] is an integer vector specifying the tests to be performed on the ith file. Default: 1:4

Value

integer vector of same length as files, with values from this list:

  • 0: the file passes all tests

  • 1: the file doesn't exist

  • 2: the file is empty.

  • 3: the file is non-empty but all zeroes

  • 4: the file is non-empty and has a .gz, .bz2, .7z, .rar, or .zip extension, but fails the integrity test of the appropriate archiving program

For each input file, the function returns either 0, or the number of the first test to fail. Tests are attempted in order of increasing number.

Author(s)

John Brzustowski jbrzusto@REMOVE_THIS_PART_fastmail.fm


MotusWTS/motusServer documentation built on Aug. 8, 2024, 10:23 p.m.