6.4.5 Standard I/O - where stdin, stdout, stderr come from
2 of the 3 standard I/O streams are no real problem:
- ‘stdin’ is set to the value the ‘Input()’ function of ‘dos.library’
- ‘stdout’ is set to the ‘Output()’ value.
Both streams are managed by the OS and the library need not take much
care about them. But ‘stderr’ is a different thing since
there is no ‘Errput()’ ;-) function. So ‘stderr’ is handled
- If ‘process->pr_CES’ is set, this value is taken. There are not
much shells that set this value so most of the time this leads to NULL.
- If this didn't work and your program was started from CLI the library
This opens the last interactive terminal attached to stdout, i.e.
if you use the normal Amiga shell and redirect your output to a file you
get the terminal, if you redirect your output to ‘NIL:’ you get ‘NIL:’.
- If this didn't work too (you never know) or your program was started from WB
you simply get the same stream as in ‘stdout’.