piet@cs.ruu.nl (Piet van Oostrum) (10/25/89)
Which filehandle should be used for stderr? I have seen compilers that use 2 and others that use -1. If you use 2: you can redirect stderr, but it is not official TOS usage (2 is supposed to be stdaux). So you need a sheel that sets up 2 to default to the console. On the other hand it is Unix compatible. If you use -1: it is TOS standard, compatible with the desktop, but you can't redirect it to a file. So either way you seem to lose. What are your feelings about this? -- Piet van Oostrum, Dept of Computer Science, University of Utrecht Padualaan 14, P.O. Box 80.089, 3508 TB Utrecht, The Netherlands. Telephone: +31-30-531806 Internet: piet@cs.ruu.nl Telefax: +31-30-513791 Uucp: uunet!mcsun!hp4nl!ruuinf!piet
apratt@atari.UUCP (Allan Pratt) (10/26/89)
piet@cs.ruu.nl (Piet van Oostrum) writes: >Which filehandle should be used for stderr? I have seen compilers that use >2 and others that use -1. >If you use 2: you can redirect stderr, but it is not official TOS usage (2 >is supposed to be stdaux). So you need a sheel that sets up 2 to default to >the console. On the other hand it is Unix compatible. >If you use -1: it is TOS standard, compatible with the desktop, but you >can't redirect it to a file. Boy, if only all the questions on the net were this well thought out and concise. Way to go, Piet! My personal opinion, not to be construed as an Atari policy statement, is that handle 2 is a fine choice. I realize it requires a shell which supports it, but I think it's worth the effort. You can even tell if you've been run from the Desktop, and if you are, you Fforce handle 2 to -1 or something. (You can tell if you're launched from the Desktop by checking for a CR character just PAST the end of your command line. It's not very nice, but it works. Here's the code you'd have to use in your startup, before anybody munges the command line.) ---------------------------------------- move.l <basepage>,a0 lea.l $80(a0),a0 move.b (a0)+,d0 ext.w d0 cmp.b #$d,(d0,a0) bne notdesktop ... launched from desktop ... bra done notdesktop: ... not launched from desktop ... done: ---------------------------------------- Of course, if your shell puts a CR there in a misguided attempt at being compatible with the desktop, you'll be in trouble. Another way to tell is to see if there's anything but PATH in your environment: most shells put SOMETHING there... ============================================ Opinions expressed above do not necessarily -- Allan Pratt, Atari Corp. reflect those of Atari Corp. or anyone else. ...ames!atari!apratt