File: assertions-file.Rd

package info (click to toggle)
r-cran-assertthat 0.2.1-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, sid
  • size: 220 kB
  • sloc: sh: 9; makefile: 2
file content (42 lines) | stat: -rw-r--r-- 755 bytes parent folder | download | duplicates (3)
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
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/assertions-file.r
\name{assertions-file}
\alias{assertions-file}
\alias{is.dir}
\alias{is.writeable}
\alias{is.readable}
\alias{has_extension}
\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))
}