The R Project SVN R

Rev

Rev 61168 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 61168 Rev 61433
Line 16... Line 16...
16
}
16
}
17
\arguments{
17
\arguments{
18
  \item{op}{a character string specifying the test to be performed.
18
  \item{op}{a character string specifying the test to be performed.
19
    Unary tests (only \code{x} is used) are \code{"-f"} (existence and
19
    Unary tests (only \code{x} is used) are \code{"-f"} (existence and
20
    not being a directory), \code{"-d"} (existence and directory) and
20
    not being a directory), \code{"-d"} (existence and directory) and
21
    \code{"-x"} (executable as a file or searchable as a directory). 
21
    \code{"-x"} (executable as a file or searchable as a directory).
22
    Binary tests are \code{"-nt"} (strictly newer than, using the modification
22
    Binary tests are \code{"-nt"} (strictly newer than, using the modification
23
    dates) and \code{"-ot"} (strictly older than): in both cases the
23
    dates) and \code{"-ot"} (strictly older than): in both cases the
24
    test is false unless both files exist.}
24
    test is false unless both files exist.}
25
  \item{x, y}{character vectors giving file paths.}
25
  \item{x, y}{character vectors giving file paths.}
26
}
26
}
Line 28... Line 28...
28
  \sQuote{Existence} here means being on the file system and accessible
28
  \sQuote{Existence} here means being on the file system and accessible
29
  by the \code{stat} system call (or a 64-bit extension) -- on a
29
  by the \code{stat} system call (or a 64-bit extension) -- on a
30
  Unix-alike this requires execute permission on all of the directories in
30
  Unix-alike this requires execute permission on all of the directories in
31
  the path that leads to the file, but no permissions on the file
31
  the path that leads to the file, but no permissions on the file
32
  itself.
32
  itself.
33
  
33
 
34
  For the meaning of \code{"-x"} on Windows see \code{\link{file.access}}.
34
  For the meaning of \code{"-x"} on Windows see \code{\link{file.access}}.
35
}
35
}
36
\seealso{
36
\seealso{
37
  \code{\link{file.exists}} which only tests for existence
37
  \code{\link{file.exists}} which only tests for existence
38
  (\code{test -e} on some systems) but not for not being a directory.
38
  (\code{test -e} on some systems) but not for not being a directory.
39
  
39
 
40
  \code{\link{file.path}}, \code{\link{file.info}}
40
  \code{\link{file.path}}, \code{\link{file.info}}
41
}
41
}
42
\examples{
42
\examples{
43
dir <- file.path(R.home(), "library", "stats")
43
dir <- file.path(R.home(), "library", "stats")
44
file_test("-d", dir)
44
file_test("-d", dir)