Mark as a file by adding classes

as_file(path)

Arguments

path

file path

Value

path with classes set to "file" and "file_{ext}" where ext is the file extension

Examples

tf <- tempfile(fileext = ".txt")
writeLines("", tf)

as_file(tf)
#> File /tmp/RtmpXCeuoO/file24c116632101.txt