Menu

#1433 binary filetype detection too early

closed-accepted
nobody
binary (3)
5
2015-03-23
2014-06-22
Anonymous
No

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"

Discussion

  • Ethan Merritt

    Ethan Merritt - 2014-06-22
     
  • Ethan Merritt

    Ethan Merritt - 2014-06-22

    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?

     
  • Karl Ratzsch

    Karl Ratzsch - 2014-06-22

    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?)

     
  • Ethan Merritt

    Ethan Merritt - 2014-06-24
    • status: open --> closed-accepted
     

Log in to post a comment.