With V5/V6 C I/O was a lot like what Larry was describing for getopts(3) it was all over over the map. There was the portable I/O library which I sort of think of as the prequel to studio but I don’t remember uSing it much. I must have run into most of the different ways people did I/O in some program(s) but I don’t remember any one off hand.
I think the thing to remember is that at the time system programming languages such as C and Bliss were noted for not having I/O built into the language- it was supported externally. DEC (CMU) with Bliss had rich set of libraries (often in assembler already available) and force/matched by them with their users. Unix and C grew up independently which I think is part of why it was a tad more random. BY the time dmr adds stdio, it was still early enough in the life to displace the randomness for something as important as I/O, whereas lack of use of something.like getopt would not become clearly deficient until after widespread success.
On Sun, Jul 1, 2018, at 07:34, ron@ronnatalie.com wrote:
> The bigger issue with the early printf is it just called putchar and
> putchar only output to stdout or what ever the global fout variable was
> set to.
> There was a comment in the manual that the fout concept was kludgy.
V6 'iolib' printf has an interesting approach to fixing this:
If the first argument was 0 through 9, it was taken to be a file descriptor, and the second argument was the format string. If it was -1, the second argument was the output string (as for later sprintf), and the third was the format string. Otherwise, the first argument was the format string.
(I'm curious as to how much "iolib" was actually used, since it doesn't appear to have been included by default - there was a different printf routine in libc)
--
Sent from a handheld expect more typos than usual