Sys.readlink: Read File Symbolic Links

Description Usage Arguments Value See Also


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.





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


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 "".

See Also

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

Questions? Problems? Suggestions? or email at

Please suggest features or report bugs with the GitHub issue tracker.

All documentation is copyright its authors; we didn't write any of that.