This is the mail archive of the
cygwin@sources.redhat.com
mailing list for the Cygwin project.
Re: shouldn't pipes and redirection have the SAME mode?
- To: johnr at imageworks dot com
- Subject: Re: shouldn't pipes and redirection have the SAME mode?
- From: DJ Delorie <dj at delorie dot com>
- Date: Fri, 9 Feb 2001 22:16:32 -0500
- CC: cygwin at cygwin dot com
- 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