Function: access-file
access-file is a function defined in fileio.c.
Signature
(access-file FILENAME STRING)
Documentation
Access file FILENAME, and get an error if that does not work.
The second argument STRING is prepended to the error message. If there is no error, returns nil.
Probably introduced at or before Emacs version 20.1.
Source Code
// Defined in /usr/src/emacs/src/fileio.c
{
Lisp_Object handler, encoded_filename, absname;
CHECK_STRING (filename);
absname = Fexpand_file_name (filename, Qnil);
CHECK_STRING (string);
/* If the file name has special constructs in it,
call the corresponding file name handler. */
handler = Ffind_file_name_handler (absname, Qaccess_file);
if (!NILP (handler))
return calln (handler, Qaccess_file, absname, string);
encoded_filename = ENCODE_FILE (absname);
if (sys_faccessat (AT_FDCWD, SSDATA (encoded_filename), R_OK,
AT_EACCESS) != 0)
report_file_error (SSDATA (string), filename);
return Qnil;
}