Utility function to access information about files on the user's file systems.
file.access(names, mode = 0)
| Parameter | Description |
|---|---|
names |
character vector containing file names. Tilde-expansion will be done: see path.expand. |
mode |
integer specifying access mode required: see ‘Details’. |
# NOT RUN {
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, 4) == 0] # hopefully all are readable
d[file.access(df, 2) == 0] # they may or may not be writable
# }