0th

Percentile

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.

Keywords
file
##### Usage
Sys.readlink(paths)
##### Arguments
paths

character vector of file paths. Tilde expansion is done: see path.expand.

##### Value

A character vector of the same length as paths. The entries are the path of the file linked to, "" if the path is not a symbolic link, and NA if there is an error (e.g., the path does not exist).

On platforms without the readlink system call, all elements are "".

file.symlink for the creation of symbolic links (and their Windows analogues), file.info

##### Examples
library(base) # 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") # } 
Documentation reproduced from package base, version 3.6.0, License: Part of R 3.6.0

### Community examples

Looks like there are no examples yet.