Is there a list of device numbers somewhere? I've searched the manual with no luck. Something like:
Device Name Device#
keyboard 0
crt 1
etc
etc
As well, are:
STDIN
STDOUT
STDERR
defined?
Can I use STDIN in code to mean device#0? etc...
If you create new file handles, numbering seems to start at 3. So that leaves 1 and 2 unaccounted for, as 0 is stdin/stdout. Dunno what 1 and 2 might do.
Perhaps you don't need to specify stdin/stdout, as they're the default until you choose another IO device.
Or you could do stuff like this:
(constant 'stdin 0 'stdout 0)
(device stdout)
(read-line stdin)
but it looks unnecessary to me.
Quote from: "cormullion"
If you create new file handles, numbering seems to start at 3. So that leaves 1 and 2 unaccounted for, as 0 is stdin/stdout. Dunno what 1 and 2 might do.
Perhaps you don't need to specify stdin/stdout, as they're the default until you choose another IO device.
Or you could do stuff like this:
(constant 'stdin 0 'stdout 0)
(device stdout)
(read-line stdin)
but it looks unnecessary to me.
1 is stdout. 2 is stderr. 0 is stdin.
Makes sense!
Quote from: "TedWalther"
Quote from: "cormullion"
If you create new file handles, numbering seems to start at 3. So that leaves 1 and 2 unaccounted for, as 0 is stdin/stdout. Dunno what 1 and 2 might do.
Perhaps you don't need to specify stdin/stdout, as they're the default until you choose another IO device.
Or you could do stuff like this:
(constant 'stdin 0 'stdout 0)
(device stdout)
(read-line stdin)
but it looks unnecessary to me.
1 is stdout. 2 is stderr. 0 is stdin.
Is this documented anywhere that I should have stumbled upon? Anyway, thanks for the heads-up!
Quote from: "dukester"
Quote from: "TedWalther"
Quote from: "cormullion"
If you create new file handles, numbering seems to start at 3. So that leaves 1 and 2 unaccounted for, as 0 is stdin/stdout. Dunno what 1 and 2 might do.
Perhaps you don't need to specify stdin/stdout, as they're the default until you choose another IO device.
Or you could do stuff like this:
(constant 'stdin 0 'stdout 0)
(device stdout)
(read-line stdin)
but it looks unnecessary to me.
1 is stdout. 2 is stderr. 0 is stdin.
Is this documented anywhere that I should have stumbled upon? Anyway, thanks for the heads-up!
It is a standard C/Unix thing. You would come across it in the beginning of any discussion of file handles and file io.