wayne@ames.arpa (09/02/87)
Regarding perror()'s crypticness and "UNIX philosophy" and the like, I should have mentioned that I became a little spoiled on error messages several years ago (more like 17). You see, the first time-sharing system I really got into was TSS/360, from (yep) IBM. (This is the operating system IBM wishes they had never promised on hardware they pretend they never built, the 360/67; it actually ran very well when given adequate iron, such as a 168 or 3000-series.) In TSS, "behaving" applications (and scripts and such) did not write messages themselves, but rather provided the equivalent of errno to a standard system routine (and command), which looked up the number in a system-wide file. In the file was the text of the message (in several user-selectable forms, for "experts", "beginners," etc.), a severity level (so that uninteresting messages could be suppressed on a per- user basis), and optional "help" text (which could be requested by the user after seeing the normal message). This mechanism was also used for prompting for input, and the file contained default values to be used for each field. [Note that this "message number" was in fact a text string, generally made up of a module name and an error-number- within-module. This was NOT usually displayed to the user, however, unless specifically requested (some wizards actually liked running with ONLY the message number, since they knew what they all meant anyway and it was quicker to print!).] Furthermore, each user could provide his or her own version of (any part of) this file, which would be searched first. I had different text, severity, defaults, etc. for probably 50 messages that I either got tired of seeing, wanted to be shorter, or felt needed higher visibility. And of course, you could change the language of messages (two major TSS accounts were in Germany, and their messages came out in German); on input you could change the order of the parameters, the default values, the descriptions, etc.; you could share message files for individual groups, to make the messages more meaningful ("The English Department has not given you permission to run this program; call extension 555 for assistance."); and anyone could define new message numbers without having to change the system file. While the system was hardly perfect, I was never once told that somebody I was sending mail to was not a teletype! Oh, and if you (or your program) happened to give the message handler a number it could not find, it printed something like: Text for message 'newmod666' not found. Wayne Hathaway ultra!wayne@Ames.ARPA Ultra Network Technologies 2140 Bering drive with a domain server: San Jose, CA 95131 wayne@Ultra.COM 408-922-0100 PS: In my original flamette, I did put "UNIX philosophy" in quotes, to indicate an unusual (in this case, facetious) usage; I should probably have thrown in a :-) or two. PPS: I do know how to spell "minuscule" ...
rml@hpfcdc.HP.COM (Bob Lenk) (09/23/87)
>Maybe I am missing something here... I see how easy it would be to >insert the code to output the error number, but why bother? If perror >doesn't know what the error is, (meaning, the number is greater than sys_nerr), >what good will knowing the number do you? WHERE ARE YOU GOING TO LOOK IT UP? It's quite possible that the program was compiled and linked under an older system, when sys_nerr was smaller, but run on a newer system that defines (and presumably documents) new errors. Bob Lenk (hpfcla!rml)