directory.access: Check Whether Path is a Directory

View source: R/directory_access.R

directory.accessR Documentation

Check Whether Path is a Directory

Description

Validates whether a directory exists and checks its read/write access along with content counts. Supports both local and UNC network paths.

Usage

directory.access(path)

Arguments

path

Character string. Directory path to validate.

Value

A list of class directory_access_result containing:

  • path - Normalized directory path

  • exists - TRUE/FALSE

  • readable - TRUE/FALSE

  • writable - TRUE/FALSE

  • file_count - Number of files in directory

  • folder_count - Number of subdirectories

  • empty - TRUE/FALSE

  • status - Overall status message

Examples

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

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


# UNC network path (requires network access)
directory.access("//server/share/project")



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