assertive.files v0.0-2

0

Monthly downloads

0th

Percentile

Assertions to Check Properties of Files

A set of predicates and assertions for checking the properties of files and connections. This is mainly for use by other package developers who want to include run-time testing features in their own packages. End-users will usually want to use assertive directly.

Readme

Project Status: Active - The project has reached a stable, usable state and is being actively developed. Is the package on CRAN? SemaphoreCI Build Status AppVeyor Build Status

assertive.files

A set of predicates and assertions for checking the files of variables, such as length, names and attributes. Most of the documentation is on the assertive page. End-users will usually want to use assertive directly.

Installation

To install the stable version, type:

install.packages("assertive.files")

To install the development version, you first need the devtools package.

install.packages("devtools")

Then you can install the assertive.files package using

library(devtools)
install_bitbucket("richierocks/assertive.files")

Predicates

Functions for files:

is_dir checks if a path corresponds to a directory.

is_empty_file checks if a path corresponds to an empty file.

is_existing_file checks if a path corresponds to an existing file.

is_readable_file, is_writable_file, and is_executable_file check a file's permissions. (Though they are based upon base::file.access, which sometimes gives unexpected results under Windows.)

is_library checks if a path corresponds to a library that R knows about.

Functions for connections:

is_connection checks if a variable is a connection.

is_bzfile_connection, is_fifo_connection, is_file_connection, is_gzfile_connection, is_pipe_connection, is_socket_connection, is_terminal_connection, is_text_connection, is_unz_connection, and is_url_connection check for these specific connection types.

is_stderr, is_stdin, and is_stdout check for these standard connections.

is_incomplete_connection, is_open_connection, is_readable_connection, and is_writable_connection check for these properties of connections.

Assertions

Predicates that return a vector have two corresponding assertions. For example, is_dir has assert_all_are_dirs and assert_any_are_dirs.

Predicates returning a single logical value have one corresponding assertion. For example, is_stdin has assert_is_stdin.

Functions in assertive.files

Name Description
assert_is_bzfile_connection Is the input a connection?
assert_all_are_executable_files Is the file accessible?
assert_all_are_libraries Is the directory a known R library?
assert_all_are_existing_files Does the file exist?
as.character.file Convert file connections to strings
assert_all_are_empty_files Is a file too big or small?
assert_all_are_dirs Is the path a directory? Checks to see if the input path is a directory.
No Results!

Last month downloads

Details

Type Package
Date 2016-05-10
URL https://bitbucket.org/richierocks/assertive.files
BugReports https://bitbucket.org/richierocks/assertive.files/issues
License GPL (>= 3)
LazyLoad yes
LazyData yes
Acknowledgments Development of this package was partially funded by the Proteomics Core at Weill Cornell Medical College in Qatar . The Core is supported by 'Biomedical Research Program' funds, a program funded by Qatar Foundation.
Collate 'imports.R' 'assert-is-connection.R' 'assert-is-file-size.R' 'assert-is-file.R' 'internal-connection.R' 'is-connection.R' 'is-file-size.R' 'is-file.R'
RoxygenNote 5.0.1
ByteCompile true
NeedsCompilation no
Packaged 2016-05-10 07:49:25 UTC; rjc2003
Repository CRAN
Date/Publication 2016-05-10 10:30:32

Include our badge in your README

[![Rdoc](http://www.rdocumentation.org/badges/version/assertive.files)](http://www.rdocumentation.org/packages/assertive.files)