Learn R Programming

reproducible (version 3.2.1)

.expandAlsoExtractPatterns: Expand regex patterns in alsoExtract against a known list of archive files.

Description

For each element of alsoExtract that is not a literal match in filesInArchive (by relative path or basename), the element is treated as a regular expression and grep()-ed against filesInArchive. Matched names replace the pattern; unmatched patterns are kept as-is so that downstream code can emit a useful "file not found" error. Special sentinel values ("similar", "none", NA) are passed through unchanged.

Usage

.expandAlsoExtractPatterns(alsoExtract, filesInArchive)

Value

A character vector with pattern elements replaced by their matches.

Arguments

alsoExtract

Character vector (or NULL).

filesInArchive

Character vector of files inside the archive, as returned by makeRelative(.listFilesInArchive(archive), destinationPath).

Details

This lets users write e.g. alsoExtract = "CMD_sm|CMD_sp" to select all archive members whose name contains CMD_sm or CMD_sp.