read.access: Check Whether File or Directory is Readable

View source: R/read_access.R

read.accessR Documentation

Check Whether File or Directory is Readable

Description

Validates whether a file or directory exists and can be accessed for reading. Supports both local and UNC network paths.

Usage

read.access(path)

Arguments

path

Character string. Full path to file or directory.

Value

A list of class read_access_result containing:

  • path - Normalized input path

  • exists - TRUE/FALSE

  • type - "File" or "Directory"

  • readable - TRUE/FALSE

  • status - Overall status message

Examples

# Check a temporary directory
result <- read.access(tempdir())
print(result)

# Check an existing temporary file
tmp <- tempfile()
writeLines("hello", tmp)
result <- read.access(tmp)
print(result)
unlink(tmp)

# Check a path that does not exist
result <- read.access(file.path(tempdir(), "no_such_file.csv"))
print(result)


# UNC network path (requires network access)
read.access("//server/share/data/file.csv")



fileaccess documentation built on June 18, 2026, 1:06 a.m.