buffer-file-number is a variable defined in `files.el'.
Its value is

  • Automatically becomes permanently buffer-local when set.

The device number and file number of the file visited in the current buffer.
The value is a list of the form (FILENUM DEVNUM).
This pair of numbers uniquely identifies the file.
If the buffer is visiting a new file, the value is nil.