R.utils (version 1.3.0)

fileAccess: Checks the permission of a file or a directory

Description

Checks the permission of a file or a directory.

Usage

## S3 method for class 'default':
fileAccess(pathname, mode=0, safe=TRUE, ...)

Arguments

pathname
A character string of the file or the directory to be checked.
mode
An integer (0,1,2,4), cf. file.access().
safe
If TRUE, the permissions are tested more carefully, otherwise file.access() is used.
...
Not used.

Value

  • Returns an integer; 0 if the permission exists, -1 if not.

Details

In Rthere is file.access() for checking whether the permission of a file. Unfortunately, this function cannot be 100% trusted depending on platform used and file system queried, cf. [1].

References

[1] R-devel thread file.access() on network (mounted) drive on Windows Vista? on Nov 26, 2008.

See Also

file.access()