Find out if a file path is a symbolic link, and if so what it is linked to, via the system call readlink. Symbolic links are a POSIX concept, not implemented on Windows but for most filesystems on Unix-alikes.
Sys.readlink(paths)
| Parameter | Description |
|---|---|
paths |
character vector of file paths. Tilde expansion is done: see path.expand. |
# NOT RUN {
##' To check if files (incl. directories) are symbolic links:
is.symlink <- function(paths) isTRUE(nzchar(Sys.readlink(paths), keepNA=TRUE))
## will return all FALSE when the platform has no `readlink` system call.
is.symlink("/foo/bar")
# }