-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathis_file.Rd
51 lines (44 loc) · 1.17 KB
/
is_file.Rd
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
43
44
45
46
47
48
49
50
51
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/is.R
\name{is_file}
\alias{is_file}
\alias{is_dir}
\alias{is_link}
\alias{is_file_empty}
\title{Functions to test for file types}
\usage{
is_file(path, follow = TRUE)
is_dir(path, follow = TRUE)
is_link(path)
is_file_empty(path, follow = TRUE)
}
\arguments{
\item{path}{A character vector of one or more paths.}
\item{follow}{If \code{TRUE}, symbolic links will be followed (recursively) and
the results will be that of the final file rather than the link.}
}
\value{
A named logical vector, where the names give the paths. If the given
object does not exist, \code{NA} is returned.
}
\description{
Functions to test for file types
}
\examples{
\dontshow{.old_wd <- setwd(tempdir())}
dir_create("d")
file_create("d/file.txt")
dir_create("d/dir")
link_create(path(path_abs("d"), "file.txt"), "d/link")
paths <- dir_ls("d")
is_file(paths)
is_dir(paths)
is_link(paths)
# Cleanup
dir_delete("d")
\dontshow{setwd(.old_wd)}
}
\seealso{
\code{\link[=file_exists]{file_exists()}}, \code{\link[=dir_exists]{dir_exists()}} and \code{\link[=link_exists]{link_exists()}} if you want
to ensure that the path also exists.
}