[Rd] An inconsistency in docs for file.access(base)

From: Keith Satterley <keith_at_wehi.EDU.AU>
Date: Mon, 16 Feb 2009 17:40:27 +1100


I was chasing a "no permission to install to directory" error message. I was looking in the code for /R/trunk/src/library/tools/R/install.R which pointed me to the file.access function.

On reading the help for this function, it has the following in the Details section:

The mode value can be the exclusive or of the following values 0 test for existence.
1 test for execute permission.
2 test for write permission.
4 test for read permission.

It has the following under the Examples section:

Examples
fa <- file.access(dir("."))
table(fa) # count successes & failures
d <- dir(file.path(R.home(), "bin"))
df <- dir(file.path(R.home(), "bin"), full.names = TRUE)

d[file.access(df, 0) == 0] # all exist
d[file.access(df, 1) == 0] # some are executable, some are not
d[file.access(df, 2) == 0] # hopefully all are readable
d[file.access(df, 4) == 0] # they may or may not be writable

I presume mode = 2 is a test for writing, so could someone change the comments around in the Examples

> sessionInfo()

R version 2.9.0 Under development (unstable) (2009-01-15 r47607) i386-pc-mingw32

locale:
LC_COLLATE=English_Australia.1252;LC_CTYPE=English_Australia.1252;LC_MONETARY=English_Australia.1252;LC_NUMERIC=C;LC_TIME=English_Australia.1252

attached base packages:
[1] stats graphics grDevices datasets utils methods base

loaded via a namespace (and not attached): [1] tools_2.9.0

Same situation in R2.8.1

cheers,

Keith



Keith Satterley
Bioinformatics Division
The Walter and Eliza Hall Institute of Medical Research Parkville, Melbourne,
Victoria, Australia

R-devel_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel Received on Mon 16 Feb 2009 - 05:43:36 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Mon 16 Feb 2009 - 11:30:23 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-devel. Please read the posting guide before posting to the list.

list of date sections of archive