EVOLUTION-MANAGER
Edit File: filetest.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: Shell-style Tests on Files</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 file_test {utils}"><tr><td>file_test {utils}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2> Shell-style Tests on Files </h2> <h3>Description</h3> <p>Utility for shell-style file tests. </p> <h3>Usage</h3> <pre> file_test(op, x, y) </pre> <h3>Arguments</h3> <table summary="R argblock"> <tr valign="top"><td><code>op</code></td> <td> <p>a character string specifying the test to be performed. Unary tests (only <code>x</code> is used) are <code>"-f"</code> (existence and not being a directory), <code>"-d"</code> (existence and directory) and <code>"-x"</code> (executable as a file or searchable as a directory). Binary tests are <code>"-nt"</code> (strictly newer than, using the modification dates) and <code>"-ot"</code> (strictly older than): in both cases the test is false unless both files exist.</p> </td></tr> <tr valign="top"><td><code>x, y</code></td> <td> <p>character vectors giving file paths.</p> </td></tr> </table> <h3>Details</h3> <p>‘Existence’ here means being on the file system and accessible by the <code>stat</code> system call (or a 64-bit extension) – on a Unix-alike this requires execute permission on all of the directories in the path that leads to the file, but no permissions on the file itself. </p> <p>For the meaning of <code>"-x"</code> on Windows see <code><a href="../../base/html/file.access.html">file.access</a></code>. </p> <h3>See Also</h3> <p><code><a href="../../base/html/files.html">file.exists</a></code> which only tests for existence (<code>test -e</code> on some systems) but not for not being a directory. </p> <p><code><a href="../../base/html/file.path.html">file.path</a></code>, <code><a href="../../base/html/file.info.html">file.info</a></code> </p> <h3>Examples</h3> <pre> dir <- file.path(R.home(), "library", "stats") file_test("-d", dir) file_test("-nt", file.path(dir, "R"), file.path(dir, "demo")) </pre> <hr /><div style="text-align: center;">[Package <em>utils</em> version 3.6.0 <a href="00Index.html">Index</a>]</div> </body></html>