Utility function to access information about files on the user's file systems.
file.access(names, mode = 0)
- character vector containing file names. Tilde-expansion will be done: see
- integer specifying access mode required: see ‘Details’.
mode value can be the exclusive or of the following values
- test for existence.
- test for execute permission.
- test for write permission.
- test for read permission.
Please note that it is not a good idea to use this function to test before trying to open a file. On a multi-tasking system, it is possible that the accessibility of a file will change between the time you call
file.access() and the time you try to open the file. It is better to wrap file open attempts in
An integer vector with values
-1 for failure.
This is intended as a replacement for the S-PLUS function
access, a wrapper for the C function of the same name, which explains the return value encoding. Note that the return value is false for success.
file_test for shell-style file tests.
Documentation reproduced from R 3.0.1. License: GPL-2.