ext: filename/path extension

Description Usage Arguments Details Value See Also Examples

View source: R/ext.R

Description

Get the path or file extension allowing for extensions containing .

Usage

1
ext(path, exts = getOption("fs.exts"))

Arguments

path

object such as character, vector, ; values to be converted to character. Character values should omitting the leading . (period)

exts

optional list of extensions, used when the extension contains a .

Details

ext() returns the extension of a file or path object. ext returns (the first of):

The fs::path_ext() takes only the considers the last.

Value

a fs_ext() object.

See Also

Examples

1
2
3
4
5
6
  files <- c("log.tar.gz","log.tar","log.tar.bz")
  known_exts=c("tar.gz","tar.bz")

  ext( files, exts=known_exts )
  ext( files )
  fs::path_ext( files )

decisionpatterns/cache documentation built on June 15, 2020, 9:35 p.m.