Mailing-List: contact cygwin-help@sourceware.cygnus.com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@sources.redhat.com Delivered-To: mailing list cygwin@sources.redhat.com Date: Fri, 9 Feb 2001 22:16:32 -0500 Message-Id: <200102100316.WAA27572@envy.delorie.com> X-Authentication-Warning: envy.delorie.com: dj set sender to dj@envy.delorie.com using -f From: DJ Delorie To: johnr@imageworks.com CC: cygwin@cygwin.com In-reply-to: <3A84ADB6.384EBE85@imageworks.com> (message from John Refling on Fri, 09 Feb 2001 18:55:50 -0800) Subject: Re: shouldn't pipes and redirection have the SAME mode? References: <3A84ADB6.384EBE85@imageworks.com> > It makes little sense for the above program to produce different > output depending on where the same input comes from! Of course it does. One comes from a file, and one comes from a pipe. Just because you're using "cat" doesn't mean the source is the same - consider the case where you're using gzip. The input may be text, but the output certainly is going to be binary. The two must be treated differently. Consider my machine, where some directories default to text mode and others default to binary mode. If you redirect from different files, the modes are different. Now if you use cat, how is your ./a supposed to know where *cat* got its file from? The mode has nothing to do with the contents of the file, only on where it resides. You can't tell where it resides when you're reading from a pipe. -- Want to unsubscribe from this list? Check out: http://cygwin.com/ml/#unsubscribe-simple