Skip to contents

Validates and sanitizes file paths to prevent directory traversal attacks and ensure safe file operations.

Usage

sanitize_file_path(file_path, allow_relative = FALSE)

Arguments

file_path

Character string representing a file path

allow_relative

Logical. Allow relative paths. Default: FALSE.

Value

Sanitized file path or throws error if invalid