extract_cran_path_parts: Splits repository "contrib"-paths into a directory path and...

View source: R/handlers-static.R

extract_cran_path_partsR Documentation

Splits repository "contrib"-paths into a directory path and filename.

Description

Splits the requested path into directory-part and filename-part, while ensuring some security to where it may point to.

Usage

extract_cran_path_parts(s)

Arguments

s

The requested path, e.g. src/contrib or bin/windows/contrib/4.0/my_package_v0.1.0.zip.

Value

A character vector of length 2, with directory path and filename. If s was a directory (e.g., "src/contrib", "src/contrib/", "bin/windows/contrib/4.0", etc.) the second element is "". Can return NULL if s does not fit the repository directory structure.


microCRAN documentation built on Nov. 4, 2023, 1:07 a.m.