EVOLUTION-MANAGER
Edit File: Sys.readlink.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><title>R: Read File Symbolic Links</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <link rel="stylesheet" type="text/css" href="R.css" /> </head><body> <table width="100%" summary="page for Sys.readlink {base}"><tr><td>Sys.readlink {base}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2> Read File Symbolic Links </h2> <h3>Description</h3> <p>Find out if a file path is a symbolic link, and if so what it is linked to, <em>via</em> the system call <code>readlink</code>. </p> <p>Symbolic links are a POSIX concept, not implemented on Windows but for most filesystems on Unix-alikes. </p> <h3>Usage</h3> <pre> Sys.readlink(paths) </pre> <h3>Arguments</h3> <table summary="R argblock"> <tr valign="top"><td><code>paths</code></td> <td> <p>character vector of file paths. Tilde expansion is done: see <code><a href="path.expand.html">path.expand</a></code>.</p> </td></tr> </table> <h3>Value</h3> <p>A character vector of the same length as <code>paths</code>. The entries are the path of the file linked to, <code>""</code> if the path is not a symbolic link, and <code>NA</code> if there is an error (e.g., the path does not exist). </p> <p>On platforms without the <code>readlink</code> system call, all elements are <code>""</code>. </p> <h3>See Also</h3> <p><code><a href="files.html">file.symlink</a></code> for the creation of symbolic links (and their Windows analogues), <code><a href="file.info.html">file.info</a></code> </p> <h3>Examples</h3> <pre> ##' 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") </pre> <hr /><div style="text-align: center;">[Package <em>base</em> version 3.6.0 <a href="00Index.html">Index</a>]</div> </body></html>