assertions-file {assertthat} | R Documentation |
Useful test related to files
is.dir(path)
is.writeable(path)
is.readable(path)
has_extension(path, ext)
path |
a file path to examine |
ext |
extension to test for ( |
see_if(is.dir(1))
tmp <- tempfile()
see_if(file.exists(tmp))
see_if(is.dir(tmp))
writeLines("x", tmp)
see_if(file.exists(tmp))
see_if(is.dir(tmp))
see_if(is.writeable(tmp))
see_if(is.readable(tmp))
unlink(tmp)
see_if(is.readable(tmp))