check-vector-hasAccess: Check file system access rights

check-vector-hasAccessR Documentation

Check file system access rights

Description

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

  • file.access().

  • checkmate::checkAccess().

Examples

## TRUE ====
hasAccess(c("~", "."))

## FALSE ====
hasAccess("xxx")

steinbaugh/goalie documentation built on Jan. 17, 2024, 5:16 p.m.