On 07/12/2015 01:09 PM, Carlos E. R. wrote:
On 2015-07-12 16:11, Anton Aylward wrote:
Seriously though ...
The old Software Tools model of a 'cp' program that is based around
while (ch = readch(INPUT) { writech(OUTPUT); }
isn't going to cut it any more.
:-)
Well, if you do that in turbopascal the file was always defined with a buffer (ie, inside the application) of, I think, 128 bytes. There was a method to allocate a much bigger size, and this resulted in a dramatic speed advantage when reading or writing files.
So even then, you could avoid writing a single char to disk :-)
Using the 'stdio.h' package, the books made it quite clear that IO was buffered. RT ... the books ? However the only 'write single character to disk' I've ever encountered was with a DEVC VAC editor. It was like the keyclicks were being echoed with disk 'ker-thumps'.
Yes, all this could have been avoided, but its should never have happened in the first place. It would be inconceivable with UNIX/Linux.
Because we learned and progressed :-)
Well, some of us did. Others wrote VAX VMS and tried competing with Bill Joy who was writing VAX UNIX. Later similar mistakes were made with MSDOS and some of the networking code, truing to "optimise" by agglomerating many operations into one complex command, trading orthogonality, clarity and verifiability/testability for a misplaced idea of 'efficiency'. I recall in particular attending the realise of the IBM Token Ring card and seeing two groups of software developers, nether of which was previously aware of the other's existence. One had been working on extending the Ethernet NETBIOS code to handle the TR adaptor. The was, IIR, APPC, or some such acronym from the mainframe world. The alter code was about 4 to 5 times the size of the NETBIOS implementation (for TR and Ethernet combined) and was another example of non-orthogonal primitives. Many of the developers from a PC/MSDOS world too one look at this and had a "DUH?" reaction which was obviously picked up by their accompanying salesmen and a little while later by the IBM types, who hustled the APPC people off stage before they killed all interest. One of the strengths on UNIX/Linux has always been that orthogonality, the 'file system' approach to IO that makes things 'look the same' to all programs and allows for 'pipes and filters' and 'sockets'. See man stdio man stdio.g man stdio_ext -- A: Yes. > Q: Are you sure? >> A: Because it reverses the logical flow of conversation. >>> Q: Why is top posting frowned upon? -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org