Maarten,

There's no question that this concept has existed since very early versions 
of DOS (1981), but I, personally, have never heard it referred to as such 
outside the 'C'/*nix context before.  In fact, the notion of std-whichever 
existed under CP/M, too, as we had 'C' compilers there for several years 
before the PC became dominant in the industry.   There was, under CP/M, even 
a feeble attempt (in '79 or so) at emulating a UNIX shell for CP/M.

People, then, didn't discuss this in the same terms when programming in ASM, 
FORTRAN, BASIC, COBOL, ALGOL, PL/1, PL/M, PASCAL, LISP, or any of the other 
languages popular at the time.  Since I came up through the microcomputer 
industry rather than minicomputers, where one was more likely to encounter 
'C' and its friends, the syntax seems "unix-ish" to me.

regards,

Richard Erlacher
----- Original Message ----- 
From: "Maarten Brock" <[EMAIL PROTECTED]>
To: <sdcc-user@lists.sourceforge.net>
Sent: Sunday, August 31, 2008 7:37 AM
Subject: Re: [Sdcc-user] Quickstart document


> Richard(s),
>
> DOS and Windows are no different in this regard. stdin,
> stdout and stderr have been a part of it since at least
> DOS version 2.1 (I've never used an earlier one). And
> all this piping works in them too.
>
> Maarten
>
>> stdout (stdin and stderr) are an integral part of stdio.h, so it's as 
>> much a
>> C-ism as a Unix-ism.
>>
>> I don't know how the Windows environment would cope with this, but under 
>> Unix
>> file-descriptor 0 is stdin, descriptor 1 is stdout, and 2 is stderr, and
>> these are automatically opened before the execution of main() if one 
>> includes
>> stdio.h. I should stress that I'm talking about PC-type processors now,
>> rather than the SDCC device set - the underlying assumptions about the
>> operating system don't exist for small devices, so stdio.h and its
>> accompanying libraries would probably not be meaningful for a PIC or a 
>> Z80 or
>> whatever.
>>
>> In Unix, suppose one were running a program called 'blinkey' - a nice 
>> example
>> people seem to use...
>>
>> shell$ blinkey | more
>>
>> This would pipe the stdout from 'blinkey' through to stdin of 'more'. 
>> Anything
>> blinkey wrote to stderr would appear on the screen, but if this was too 
>> much
>> to cope with one could do this...
>>
>> shell$ blinkey 2> errors.txt
>>
>> The above means to redirect file descriptor 2 (stderr) to the errors.txt 
>> file.
>>
>> Similarly, the standard input can be pulled from a file, like this...
>>
>> shell$ blinkey < blinkey_input.txt
>>
>> And then one can get smart and combine these to do all kinds of crazy 
>> things!
>>
>> I *believe* Windows/DOS can do the standard input and output bits in 
>> similar
>> fashion, but I have never had occasion to try it - I'm a dyed-in-the-wool
>> Unix (Linux) nerd, you might gather. I don't know how Windows copes with
>> descriptor 2 (stderr) if at all.
>>
>> On Saturday 30 August 2008 17:41:38 Richard Erlacher wrote:
>> > Well, that's exactly the mechanism I mentioned ... I'm not surprised it 
>> > has
>> > a name ... but -stdout ... ???  That sounds like *nix.
>> >
>> > regards,
>> >
>> > Richard Erlacher
>> >
>> > ----- Original Message -----
>> <snip>
>>
>> -- 
>> Richard.
>> PGP Key-id: 0x5AB3D350
>>
>> A reactionary is a man whose political opinions always manage to keep
>> up with yesterday.
>
>
> -------------------------------------------------------------------------
> This SF.Net email is sponsored by the Moblin Your Move Developer's 
> challenge
> Build the coolest Linux based applications with Moblin SDK & win great 
> prizes
> Grand prize is a trip for two to an Open Source event anywhere in the 
> world
> http://moblin-contest.org/redirect.php?banner_id=100&url=/
> _______________________________________________
> Sdcc-user mailing list
> Sdcc-user@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/sdcc-user 


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Sdcc-user mailing list
Sdcc-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sdcc-user

Reply via email to