buffer-file-name

buffer-file-name is a variable defined in `C source code'.
Its value is
nil

global value is the same.
  • Automatically becomes permanently buffer-local when set.
  • This variable may be risky if used as a file-local variable.

Documentation:
Name of file visited in current buffer, or nil if not visiting a file.
This should be an absolute file name.