Skip to contents

Does the input contain a file?

Usage

isFile(x)

isAFile(x, nullOk = FALSE)

allAreFiles(x)

Arguments

x

Object.

nullOk

logical(1). If set to TRUE, x may also be NULL.

Value

TRUE on success; FALSE on failure, with cause set.

Functions

  • isFile(): Vectorized.

  • isAFile(): Scalar.

  • allAreFiles(): Scalar.

Note

Updated 2023-09-29.

Examples

## TRUE ====
x <- "example.txt"
file.create(x)
#> [1] TRUE
isAFile(x)
#> [1] TRUE
unlink(x)

## FALSE ====
isFile(c("~", "."))
#> [1] FALSE FALSE