textmode, Win2k and Cygwin 1.3.2

Christopher Day Christopher.Day@cern.ch
Thu Jun 21 16:01:00 GMT 2001

I'm totally confused. I have Cygwin 1.3.2 installed on Windows 2000 Pro, Service Pack 2. Cygwin's "mount" tells me that I have my working directory mounted in textmode. The Cygwin documentation says that "od" explicitly uses binary mode (to aid CR debugging) and "cat" uses the default mode. My CYGWIN environment variable is not set at all, so from the Cygwin documentation, I expect pipes to be opened in binary mode. From the Windows 2000 side, I used Notepad to make a simple multiple line file. As far as I know, Notepad cannot avoid using <CRLF> as an end-of-line marker. From Cygwin bash, if I apply "od -x test.txt" to the test file, I see the 0a0d (counting from right to left) sequence I expect to be on the disk. If I instead do "cat test.txt | od -x" I get exactly the same result. 

In the second case, I expected "cat" not to see the <CR> on input, since it would be reading in textmode, but since its output was a pipe and CYGWIN was not set, the <CR> would not be reintroduced; "od" should always give me an accurate display of things. Hence, I expected the <CR> to be dropped. What do I have wrong?

While we're at it, what modes does "cp" use?

Chris Day
Berkeley Lab

Want to unsubscribe from this list?
Check out: http://cygwin.com/ml/#unsubscribe-simple

More information about the Cygwin mailing list