fileExt: File extension

View source: R/fileExt.R

fileExtR Documentation

File extension

Description

File extension

Usage

fileExt(path, pattern = goalie::extPattern)

Arguments

path

character. File path(s). This function is vectorized and supports multiple files.

pattern

character(1). File extension pattern.

Value

character. Character vector of same length as path input, with file extension removed. Returns NA if no extension is detected.

Note

This function intentionally doesn't check whether a file exists.

Updated 2022-05-02.

See Also

tools::file_ext(). Note that this returns character() instead of NA on extension match failure.

Examples

fileExt(c("dir/foo.txt", "dir/bar.tar.gz", "dir/"))

acidgenomics/r-acidbase documentation built on Jan. 12, 2024, 3:56 a.m.