This is the mail archive of the cygwin@sources.redhat.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: shouldn't pipes and redirection have the SAME mode?



> 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]