delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2001/02/09/22:17:29

Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT sources DOT redhat DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT sources DOT redhat DOT com>
List-Help: <mailto:cygwin-help AT sources DOT redhat DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT sources DOT redhat DOT com
Delivered-To: mailing list cygwin AT sources DOT redhat DOT 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 AT envy DOT delorie DOT com using -f
From: DJ Delorie <dj AT delorie DOT com>
To: johnr AT imageworks DOT com
CC: cygwin AT cygwin DOT 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 DOT 384EBE85 AT imageworks DOT 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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019