#49 Change error message [ENOENT] to file not found

open
nobody
None
5
2013-09-12
2013-04-14
dosfan01
No

Change error message "Error A2106: Cannot open file: "filename" [ENOENT]" to "Error A2106: Cannot open file: "filename" - file not found."

Discussion

  • dosfan01
    dosfan01
    2013-09-12

    How about changing this to "Error A2106: Cannot open file: filename [errno=xxxx]"

    Seeing error=2 is better than ENOENT since any experienced DOS or Windows developer knows rc=2 is file not found. Also quotes are not needed around the filename and are not used in the likely unseen CANNOT_CLOSE_FILE message text. Specifying errno= would indicate that this is a C errno value and not an OS return code (though error 2 is the same for both).

    In msgdef.h:
    pick( CANNOT_OPEN_FILE, "Cannot open file: %s [errno=%u]" )
    pick( CANNOT_CLOSE_FILE, "Cannot close file: %s [errno=%u]" )

    All calls to ErrnoStr would be replaced with errno and function ErrnoStr could be deleted as it is only called for CANNOT_OPEN_FILE errors. For instance:

    Fatal( CANNOT_OPEN_FILE, CurrFName[ASM], ErrnoStr() );

    would become:

    Fatal( CANNOT_OPEN_FILE, CurrFName[ASM], errno );