public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* two text/binary oddities
@ 2004-02-19 19:02 Robert R Schneck
  2004-02-19 23:23 ` two text/binary oddities (Users Guide Alert) Christopher Faylor
  0 siblings, 1 reply; 4+ messages in thread
From: Robert R Schneck @ 2004-02-19 19:02 UTC (permalink / raw)
  To: cygwin

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/

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: two text/binary oddities (Users Guide Alert)
  2004-02-19 19:02 two text/binary oddities Robert R Schneck
@ 2004-02-19 23:23 ` Christopher Faylor
  2004-02-20  8:01   ` Joshua Daniel Franklin
  0 siblings, 1 reply; 4+ messages in thread
From: Christopher Faylor @ 2004-02-19 23:23 UTC (permalink / raw)
  To: cygwin

On Thu, Feb 19, 2004 at 06:37:12PM +0000, Robert R Schneck wrote:
>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.

Joshua, could you remove anything which indicates that CTRL-Z is
equivalent to an EOF from the user's guide?

cgf

--
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/

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: two text/binary oddities (Users Guide Alert)
  2004-02-19 23:23 ` two text/binary oddities (Users Guide Alert) Christopher Faylor
@ 2004-02-20  8:01   ` Joshua Daniel Franklin
  2004-02-20 13:42     ` Christopher Faylor
  0 siblings, 1 reply; 4+ messages in thread
From: Joshua Daniel Franklin @ 2004-02-20  8:01 UTC (permalink / raw)
  To: cygwin

On Thu, Feb 19, 2004 at 06:21:55PM -0500, Christopher Faylor wrote:
> On Thu, Feb 19, 2004 at 06:37:12PM +0000, Robert R Schneck wrote:
> >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.
> 
> Joshua, could you remove anything which indicates that CTRL-Z is
> equivalent to an EOF from the user's guide?

Done. The CYGWIN=tty section now reads, "Defaults to not set, in which case the
tty is opened in text mode. Note that this has been changed such that ^D works
as expected instead of ^Z, and is settable via stty." Does this sound accurate?

I also removed the sentence "On reading in text mode, a CR followed by an NL is
deleted and a ^Z character signals the end of file" from the Using Text and
Binary Modes section, the whole of which seems somewhat outdated. Ah,
(volunteer) job security.

I also changed all mentions of ^M to ^S, just to be mean. (Just kidding.)

--
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/

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: two text/binary oddities (Users Guide Alert)
  2004-02-20  8:01   ` Joshua Daniel Franklin
@ 2004-02-20 13:42     ` Christopher Faylor
  0 siblings, 0 replies; 4+ messages in thread
From: Christopher Faylor @ 2004-02-20 13:42 UTC (permalink / raw)
  To: cygwin

On Fri, Feb 20, 2004 at 01:34:09AM -0600, Joshua Daniel Franklin wrote:
>On Thu, Feb 19, 2004 at 06:21:55PM -0500, Christopher Faylor wrote:
>> On Thu, Feb 19, 2004 at 06:37:12PM +0000, Robert R Schneck wrote:
>> >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.
>> 
>> Joshua, could you remove anything which indicates that CTRL-Z is
>> equivalent to an EOF from the user's guide?
>
>Done. The CYGWIN=tty section now reads, "Defaults to not set, in which case the
>tty is opened in text mode. Note that this has been changed such that ^D works
>as expected instead of ^Z, and is settable via stty." Does this sound accurate?
>
>I also removed the sentence "On reading in text mode, a CR followed by an NL is
>deleted and a ^Z character signals the end of file" from the Using Text and
>Binary Modes section, the whole of which seems somewhat outdated. Ah,
>(volunteer) job security.
>
>I also changed all mentions of ^M to ^S, just to be mean. (Just kidding.)

This all sounds good.  Thanks.

I especially liked the ^M to ^S, but that's no surprise.

cgf

--
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/

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2004-02-20 13:38 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-02-19 19:02 two text/binary oddities Robert R Schneck
2004-02-19 23:23 ` two text/binary oddities (Users Guide Alert) Christopher Faylor
2004-02-20  8:01   ` Joshua Daniel Franklin
2004-02-20 13:42     ` Christopher Faylor

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).