Description Usage Arguments Value See Also Examples
Checks to see if a file is within a given size range.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 | assert_all_are_empty_files(x, severity = getOption("assertive.severity",
"stop"))
assert_any_are_empty_files(x, severity = getOption("assertive.severity",
"stop"))
assert_all_are_non_empty_files(x, severity = getOption("assertive.severity",
"stop"))
assert_any_are_non_empty_files(x, severity = getOption("assertive.severity",
"stop"))
assert_all_file_sizes_are_in_range(x, lower = 0, upper = Inf,
lower_is_strict = FALSE, upper_is_strict = FALSE, na_ignore = FALSE,
severity = getOption("assertive.severity", "stop"))
assert_any_file_sizes_are_in_range(x, lower = 0, upper = Inf,
lower_is_strict = FALSE, upper_is_strict = FALSE,
severity = getOption("assertive.severity", "stop"))
is_empty_file(x, .xname = get_name_in_parent(x))
is_non_empty_file(x, .xname = get_name_in_parent(x))
is_file_size_in_range(x, lower = 0, upper = Inf, lower_is_strict = FALSE,
upper_is_strict = FALSE, .xname = get_name_in_parent(x))
|
x |
Input to check. |
severity |
How severe should the consequences of the assertion be?
Either |
lower |
Smallest file size allowed, in bytes. |
upper |
Largest file size allowed, in bytes. |
lower_is_strict |
If |
upper_is_strict |
If |
na_ignore |
A logical value. If |
.xname |
Not intended to be used directly. |
is_empty_file
wraps file.info
, retuning TRUE
when the input is a file that exists with size zero.
assert_*_are_empty_files
return nothing but throws an error if
is_empty_file
returns FALSE
.
1 2 3 4 5 6 7 | tf <- tempfile()
file.create(tf)
is_empty_file(tf)
cat("some stuff", file = tf)
is_non_empty_file(tf)
assertive.base::dont_stop(assert_all_file_sizes_are_in_range(tf, lower = 100))
unlink(tf)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.