Path: utzoo!utgpu!watserv1!ria!uwovax!7103_2622 From: 7103_2622@uwovax.uwo.ca (Eric Smith) Newsgroups: comp.sys.atari.st Subject: Re: TOS io redirection bugs Message-ID: <4955.25d2cc93@uwovax.uwo.ca> Date: 9 Feb 90 18:58:42 GMT References: <9002081436.AA09758@freya.dmswwu-ether> Lines: 31 In article <9002081436.AA09758@freya.dmswwu-ether>, ONM07@DMSWWU1A.BITNET (Julian Reschke) writes: > In article Jwahar R. Bammi > writes: >> thats correct, but dales suggestion is still fine. its isatty() that >> needs to be fixed up, so that it does'nt think that PRN: isatty(). >> (just out of curiosity, why would someone send stderr to PRN:? why not >> to a file, and then if its really needed, print the file (saves a few >> trees in the process)). > I think that this is a very natural thing to do with stderr. IF we try > to suggest a good method, it should be possible to do all things that > you do with sterr on other OS's. If Atari makes a workings suggestion, > it will be surely incorporated in Gemini 1.2. [Dale's suggestion was for startup code to do something like if (isatty(2)) Fforce(2, -1).] How about this suggestion: if all programmers who use the Atari extended argument passing scheme (ARGV=, etc.) also agree that handle 2 should be stderr, then startup code could do: if (*argv[0] == 0 && isatty(2)) Fforce(2, -1). (This assumes that argv[0] is an empty string if it isn't available, as specified by the ANSI standard). This way, ARGV compatible shells can redirect stderr to anything at all; non-ARGV compatible shells can redirect stderr to a file; and programs still correctly re-direct handle 2 when run from the desktop. -- Eric R. Smith email: Dept. of Mathematics ERSMITH@uwovax.uwo.ca University of Western Ontario ERSMITH@uwovax.bitnet London, Ont. Canada N6A 5B7 ph: (519) 661-3638