File: file_access.Rd

package info (click to toggle)
r-cran-fs 1.6.1%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 744 kB
  • sloc: cpp: 1,288; ansic: 530; sh: 13; makefile: 2
file content (44 lines) | stat: -rw-r--r-- 1,208 bytes parent folder | download | duplicates (2)
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
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/access.R
\name{file_access}
\alias{file_access}
\alias{file_exists}
\alias{dir_exists}
\alias{link_exists}
\title{Query for existence and access permissions}
\usage{
file_access(path, mode = "exists")

file_exists(path)

dir_exists(path)

link_exists(path)
}
\arguments{
\item{path}{A character vector of one or more paths.}

\item{mode}{A character vector containing one or more of 'exists', 'read',
'write', 'execute'.}
}
\value{
A logical vector, with names corresponding to the input \code{path}.
}
\description{
\code{file_exists(path)} is a shortcut for \code{file_access(x, "exists")};
\code{dir_exists(path)} and \code{link_exists(path)} are similar but also check that
the path is a directory or link, respectively. (\code{file_exists(path)} returns
\code{TRUE} if \code{path} exists and it is a directory.)
}
\details{
\strong{Cross-compatibility warning:} There is no executable bit on
Windows. Checking a file for mode 'execute' on Windows, e.g.
\code{file_access(x, "execute")} will always return \code{TRUE}.
}
\examples{
file_access("/")
file_access("/", "read")
file_access("/", "write")

file_exists("WOMBATS")
}