Mail Archives: cygwin/2004/02/19/13:37:42
Short form:
1) "cat > foo" creates foo with DOS line endings... no matter what.
2) A control-Z in a file doesn't act as end-of-file in text mode,
despite what the Cygwin User's Guide says.
Long form:
1) Apparently, cat sometimes explicitly sets stdout to O_TEXT. This
occurs twice in the source, once with the comment
/* If stdin is a terminal device, and it is the ONLY
input file (i.e. we didn't write anything to the
output yet), switch the output back to TEXT mode.
This is so "cat > xyzzy" creates a DOS-style text
file, like people expect. */
It's certainly not what a Cygwin user with binary mounts and
CYGWIN="tty binmode" is likely to expect. I suggest that both
occurences of setting the mode of stdout be removed from the Cygwin
port of cat.
2) Well, the Cygwin User's Guide says
b. On reading in text mode, a CR followed by an NL is deleted and a ^Z
character signals the end of file.
Happily for me, only the first seems to be happening. Are the docs out
of date, or did I test insufficiently, or is the situation more
complicated?
Robert
--
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Problem reports: http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ: http://cygwin.com/faq/
- Raw text -