Skip to contents

Works for either file or directory paths.

Usage

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

TRUE on success; FALSE on failure, with cause set.

Functions

  • hasAccess(): Vectorized.

  • allHaveAccess(): Scalar.

Note

Updated 2023-09-29.

See also

Examples

## TRUE ====
hasAccess(c("~", "."))
#> [1] TRUE TRUE

## FALSE ====
hasAccess("xxx")
#> [1] FALSE