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 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42
|
\name{assertions-file}
\alias{assertions-file}
\alias{has_extension}
\alias{is.dir}
\alias{is.readable}
\alias{is.writeable}
\title{Useful test related to files}
\usage{
is.dir(path)
is.writeable(path)
is.readable(path)
has_extension(path, ext)
}
\arguments{
\item{path}{a file path to examine}
\item{ext}{extension to test for (\code{has_extension}
only)}
}
\description{
Useful test related to files
}
\examples{
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))
}
|