Description Usage Arguments Value Examples
Copies the specified file=
into the repo=
, or to the current
directory if no repository is specified. It will be renamed if asFile=
is specified, and will be put into a subdirectory of the repo if
entry=
is specified, possibly as a multi-directory path. This will be
created if needed. Assuming all optional elements are specified, the path of
the file created in the repository will be <repo>\< entry>\<asFile>
.
To validate the file before copy, expected fileSize=
and
checksum=
can be given. If inspection of file=
does not match,
an error-containing validation vector will be returned. Regardless of initial
validation, the copy will be validated using the actual file size and file
checksum after copy. Successful copy is reported as a vector of empty
strings. Problems are reported with one or more non-empty elements.
1 2 3 |
file |
The file to copy into the repo. May be relative or absolute, but
may not be a symlink or a directory. File copies will be created with permissions
"664" (read by all, write by group and owner, execute by none) and with
group |
repo |
The base directory for the repo. Must exist on the file system and should have a restrictive set of ownerships and permissions that includes restrictions on parent directories. By default will use the current directory if not specified. |
entry |
A subdirectory or subdirectory tree in the repo where the file
should be put. These will be created (recursively) if they don't exist with
the specified group owner and permissions 2775. This translates to sticky
directories with full permissions except other-write. Due to the way
|
asFile |
The new name for the file in the repository. Must be a plain
base name, not a directory (extensions are fine.) By default this is the
base name of |
writeGroup |
The file system group that all created directories and the
file copy will be assigned, if set. The default group is used if this if
left |
fileSize |
The expected size of the source file, in bytes. By default
this is |
checksum |
The expected checksum of the source file. By default this is
|
checksumFunc |
The function or function name (as a string) that will be
used when calculating checksums. The calculated source file checksum will
be verified against any provided checksums before copying and against a
recalculated checksum after copying. String function names may be qualified
with a |
A named vector of validation results. Each element is named for a check performed, and will be the empty string if the check succeeded, a failure string if the check failed, and a missing value if the check was not performed (i.e. was not wanted or previous checks failed making further checking irrelevant.)
1 2 3 4 5 6 7 8 | ## Not run:
checks <- addFile( sourcefile, repoDir, entry= 'proj_3/set_A', asFile= 's1.dat'
writeGroup= 'repoWrite', fileSize= 1234567890, checksum= sourceFileMd5 )
report <- checkSummary(checks)
if (report != '') { stop(report) }
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.