Works for either file or directory paths.

hasAccess(x, access = "r")

allHaveAccess(x, access = "r")

Arguments

x

character(1). File or directory path(s).

access

character(1). String containing any of these characters, including in combination:

  • r: read.

  • w: write.

  • x: execute.

Write and executable status cannot be checked on Windows.

Value

logical.

Functions

  • hasAccess: Vectorized.

  • allHaveAccess: Scalar.

See also

Examples

## TRUE ==== hasAccess(c("~", "."))
#> ~ . #> TRUE TRUE
## FALSE ==== hasAccess("xxx")
#> [1] FALSE #> Cause of failure: #> no access