check-vector-isSymlink: Does the input contain a symbolic link?

check-vector-isSymlinkR Documentation

Does the input contain a symbolic link?

Description

Does the input contain a symbolic link?

Usage

isSymlink(x)

isASymlink(x, nullOk = FALSE)

allAreSymlinks(x)

Arguments

x

Object.

nullOk

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

Details

Supported on Linux and macOS but not Windows.

Value

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

Functions

  • isSymlink(): Vectorized.

  • isASymlink(): Scalar.

  • allAreSymlinks(): Scalar.

Note

Updated 2023-10-02.

See Also

  • file.info().

  • Sys.readlink().

Examples

if (!isWindows()) {
    from <- "from.txt"
    to <- "to.txt"
    file.create(from)
    file.symlink(from = from, to = to)
    isSymlink(c(from, to))
    unlink(c(from, to))
}

steinbaugh/goalie documentation built on Jan. 17, 2024, 5:16 p.m.