Re: Backspacing in input
Posted in 1993
In article <C7DrH0.A2t@rbdc.wsnc.org> royc@rbdc.wsnc.org (Roy Crabtree) writes: <A discussion of "load from pipe" and using named pipes to achieve the same effect> > > One more change: reader before writer in most versions of > UNIX I know. Not SCO Unix. I just tried, and writer before reader works just fine. I don't know about others. > >>This is not an excuse for "load from pipe ..." not being part of isql. > > One of the difficulties is in detecting the difference betwen > a char string for a file (type p) and for a _proces_pipeline: > > cmd | cmd | cmd > > could also be: > > lokslikefileinpwd_BUT_iscmdfromPATH > > ... so that if you really want flexibility, you have to > distinguish the two. Yes, but in the original post, he was complaining about the lack of the "load from pipe" command on his machine/version, so this was not the issue. BTW, in most of my programs I distinguish between the two with the convention that any "file name" that begins with "|" really refers to a pipe (if I'm writing to the "file"), and any "file name" that ends with "|" refers to a pipe if I'm reading. I find this convention to be simple and intuitive. > Also, to use streaming files properly, the code inside OL > may have to be altered to do very strict "read once sequentially"; > it may in fact not do this. There are other cmds (such as tbape) > which do a doublke pump on the stream at hand; it requires very > careful coding (actually, a unifr\\orm front end IO subroutine > with buffering, pushback, etc. handled, an\\bout 10 pages of > VERY careful coding) to do these things write (errr, right)> Or you just use getc() from the C library. In general your comment may be true, but in the case of a "load from" command it's not: My "load from"-like code (written in C) is maybe 20 or 30 lines, and I would have written it exactly the same way even if I hadn't had pipes in mind (I can state this with great confidence because at the time I *didn't* have pipes in mind!) It's just not that tough! -- Bill Foote bill@pds.com PDS Corp, Los Angeles, CA USA uunet!promdist!bill