Function: file-exists-p

file-exists-p is a function defined in fileio.c.

Signature

(file-exists-p FILENAME)

Documentation

Return t if file FILENAME exists (whether or not you can read it).

Return nil if FILENAME does not exist, or if there was trouble determining whether the file exists. See also file-readable-p and file-attributes. This returns nil for a symlink to a nonexistent file. Use file-symlink-p to test for such links.

Other relevant functions are documented in the file group.

View in manual

Probably introduced at or before Emacs version 18.

Shortdoc

;; file
(file-exists-p "/tmp/foo")
    e.g. => t

Aliases

f-exists? f-exists-p

Source Code

// Defined in /usr/src/emacs/src/fileio.c
{
  return check_file_access (filename, Qfile_exists_p, F_OK);
}