Path: utzoo!attcan!uunet!mailrus!cornell!calvin.spp.cornell.edu!richard From: richard@calvin.spp.cornell.edu (Richard Brittain) Newsgroups: comp.sys.ibm.pc Subject: Re: Re^2: dir | more Message-ID: <1990Mar28.182219.4218@calvin.spp.cornell.edu> Date: 28 Mar 90 18:22:19 GMT References: <2165@orbit.cts.com> <12503@ucsd.Edu> <208@sdscal.UUCP> <0023@starsend.UUCP> Reply-To: richard@calvin.spp.cornell.edu (Richard Brittain) Organization: Cornell Space Plasma Physics Group Lines: 27 In article <0023@starsend.UUCP> floyd@starsend.UUCP (Floyd Miller) writes: >We have seen plenty answers as to why *a* file appears >when using a pipe, including how the file is used instead >of memory (as in UNIX) and that later versions of DOS >place the file in the root directory of the current drive. >However, the original question (and you can see this if you >run the "dir \ | more" experiment) asked why there are two >files created. > >I'm still waiting to see a response to that! >If the implementation of a pipe in DOS is to >create a temporary file, why are two files created? Command.com seems to be lazy, and creates a pair of pipe files whenever a pipe is encountered. If you think about it, building a multi-stage pipeline using temporary files will require at most two files e.g. dir | sort | find "foo" | more Other shells, like 4dos, only create 1 pipe file if only one is needed. If a pipe dies unexpectedly, the pipe files may not be automatically deleted, so strangely named zero length files in the root directory can become permanent. Richard Brittain, School of Elect. Eng., Upson Hall Cornell University, Ithaca, NY 14853 ARPA: richard@calvin.spp.cornell.edu UUCP: {uunet,uw-beaver,rochester,cmcl2}!cornell!calvin!richard