The filetype detection with "plot '' binary" steps in before "plot" has checked if the file even exists.
This leads to a misleading error message in case of a typo in the filename extension:
gp> set datafile binary filetype=auto gp> plot name."png" binary with rgbimage Unrecognized filetype; try "show datafile binary filetypes"
A "does not exist" error will only come after trying to open the file.
If it does not recognize the file type, how do you expect it to try to open the file?
Perhaps the errormessage is just a bit misleading: It should say the extension is unknown, and probably show the extension it found, too, see attached patch to datafile.c.
(Hm. Crashes if filename has no extension. Why is file_ext of type char, and what does file_ext++ do?)