file.exists {file} | R Documentation |
argument exist. (Here ‘exists’ is in the sense of the system's stat call: a file
will be reported as existing only if you have the permissions needed by stat.
Existence can also be checked by file.access, which might use different permissions
and so obtain a different result. Note that the existence of a file does not
imply that it is readable: for that use file.access.) What constitutes a ‘file’
is system-dependent, but should include directories. (However, directory names
must not include a trailing backslash or slash on Windows.) Note that if the file
is a symbolic link on a Unix-alike, the result indicates if the link points to
an actual file, not just if the link exists. Lastly, note the different function
exists which checks for existence of R objects.
file.exists(files,
ZERO.Nonexists = FALSE,
fs = NULL);
this function returns FALSE if the given files value is NULL