4 ms·
This is not why Windows uses CRLF, nor is it some original reason that is now obsolete. It was standard for both DOS' predecessors and early internet standards
by stormbrew 11y ago
This is not why Windows uses CRLF, nor is it some original reason that is now obsolete. It was standard for both DOS' predecessors and early internet standards because teletypes considered carriage return and linefeed separate commands, and both were built to operate with those things.
None of that stopped UNIX from getting away from it, and the internet is basically built on UNIX. What transformations the C FILE stream implementation makes to linefeeds has nothing at all to do with TELNET, SMTP, FTP, or HTTP. These are very separate areas of concern. In Windows if you're writing socket code you have to explicitly write the \r and the \n, just like on any other platform.
- WalterBright 11y agoCRLF comes from DEC operating systems. DOS was inspired by CP/M which was inspired by DEC operating system conventions. (CP/M operates remarkably like RT-11. DIR, COPY, etc., all come from DEC.)
- pvg 11y agoDEC's usage likely comes from Teletypes, though. https://en.wikipedia.org/wiki/Newline#History https://en.wikipedia.org/wiki/Newline#History
- skissane 11y ago"the internet is basically built on UNIX" is an odd thing to say. In the early days of the Internet (early 1980s, 1970s if we want to include ARPANET as the current TCP/IP-based Internet's predecessor), it was a very diverse place, with lots of DEC operating systems (TOPS-20, VMS), IBM mainframes, and various other mainframe and minicomputer vendors, with Unix by no means predominating. The Unix monoculture (and later Unix/Windows biculture) grew through the 1980s and was well-established by the 1990s. Major protocols such as IP, TCP, UDP, TELNET, FTP and SMTP were all developed prior to that Unix monoculture taking hold. FTP in particular shows the pre-Unix heritage very clearly, with support for record-oriented filesystems (STRU R, MODE B, MODE C) for DEC and IBM operating systems, support for systems that don't use 8-bit bytes (e.g. TYPE L36), built-in ASCII-EBCDIC translation (TYPE A and TYPE E), support for ASA carriage control (TYPE A C and TYPE E C), and support for TOPS-20 paged files (STRU P). (These are all features pretty meaningless on Unix systems, which is why Unix FTP clients and servers largely do not implement them.)
- e40 11y agoBut the internet as we know it grew out of the BBN networking code that was added to BSD 4. Prior to that, the patchwork connection between machines was via UUCP, mostly.
- skissane 11y agoThe current TCP/IP Internet began on flag day, 1 January 1983, when ARPANET switched from the old NCP protocol suite to TCP/IP. That was the point at which TCP/IP first entered production use. 4.2BSD was released in August 1983, which was the first production BSD version to include BBN's TCP/IP stack. 4.1a BSD was a pre-release integrating BBN's TCP/IP stack, in 1982. But that was just what was happening in Unix land; other folks at the same time were working on TCP/IP stacks for non-Unix operating systems. In particular, I understand that BBN's TCP/IP stack actually started life on TOPS-20 and was ported to BSD from there. TCP/IP began on non-Unix platforms and was only later ported to Unix.
- krylon 11y agoThere is a talk by Kirk McKusick on YouTube[1] where he tells about that time, and IIRC, Bill Joy got his hands on an early version of BBN's code, started hacking on it and put it into BSD. BBN and DARPA were not very amused, but by the time BBN's stack was finished, the BSD version had better performance and/or lower packet loss, so it stuck. Apparently Mike Muuss compared the two implementations, and his recommendation to go with Bill Joy's code was the decisive factor. [1] https://www.youtube.com/watch?v=ds77e3aO9nA https://www.youtube.com/watch?v=ds77e3aO9nA - I think that's the one
- stormbrew 11y agoFeel free to insert "as we know it", because I do not believe that the pre-1980s internet is recognizably the same thing. I will not strongly argue the point since I wasn't there. But to clarify on the salient part, I was trying to say that UNIX diverged (successfully) from what came before it, and the CRLF behaviour was from the teletype era that the early internet started in. My point about UNIX being a building block of the (modern) internet was more about pointing out that if UNIX could diverge from that and be a key component of the internet, it's absurd to think that Windows could not. I can definitely understand how you got where you did from what I said, though.