Talk:Not a typewriter
|WikiProject Computing||(Rated Start-class)|
As I recall it the usual source of the bogus message was not a "leftover" ENOTTY, but one generated after the real error when stdio determines how to buffer output on the error stream. For example:
fp = fopen("some/file", "r"); /* fails */
if(!log) log = fopen("logfile", "w"); /* buffering test on open generates ENOTTY */
fprintf(log, "%s\n", sys_errlist[errno]); /* prints "Not a typewriter" */
- The page is correct. After initializing stdio, if standard input or output was not a tty device, errno was set to ENOTTY. Subsequent erroneous calls to strerror() or perror() produced this message. If isatty() restores errno, then typically you get erroneous "Error 0" messages.
- On Microsoft operating systems, the analogous failure message was "The operation completed successfully", leading to naive applications producing errors like "Could not refrib the widget because: the operation completed successfully." Examples at http://stackoverflow.com/questions/1209769/system-componentmodel-win32exception-the-operation-completed-successfully and http://blogs.technet.com/b/appv/archive/2011/03/10/getting-rid-of-the-pop-up-message-the-operation-completed-successfully-when-running-virtualized-office-2010-under-app-v.aspx -- Resuna (talk) 21:07, 16 January 2013 (UTC)
If this error code is returned, then at some point a diagnostic message may be output. Because some people consider "Not a typewriter" to be a confusing message some systems display a different confusing message such as "Inappropriate ioctl for device" instead. The real source of these confusing messages is, alas, often more subtle.