This is the mail archive of the cygwin 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]
Other format: [Raw text]

Re: sed strips CRs


Paolo Bonzini scripsit:

> By the way, I'm still opening the script file with "rt".  I cannot think  
> of any case when you would want to keep CRs there.

You wouldn't, but the point is that "rt" isn't defined on Posix systems.
If it happens to be the same as "r", good, but that isn't guaranteed.
And the only time "rt" does anything different from "r" on a Win32 system
is when you have:

1) linked your executable with the system-supplied 'binmode.obj' file

2) set the global variable _fmode to O_BINARY

3) invoked _set_fmode(O_BINARY)

all of which make "r" synonymous with "rb".  Programs which don't do any
of these should use "r" rather than "rt", as it is guaranteed to do the
right thing for text on both Win32 and Posix systems.

-- 
You annoy me, Rattray!  You disgust me!         John Cowan
You irritate me unspeakably!  Thank Heaven,     cowan@ccil.org
I am a man of equable temper, or I should       http://www.ccil.org/~cowan
scarcely be able to contain myself before
your mocking visage.            --Stalky imitating Macrea

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      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]