File reading problem with -mno-cygwin
Joe Hagen
jdhagen@chorus.net
Wed Sep 4 20:53:00 GMT 2002
Andrew DeFaria wrote:
>
> One question remains however and that is why would it work in Cygwin
> but not in -mno-cygwin? My theory is that opening a file with "r"
> under Cygwin is equivalent to "rb".
Andrew,
Using the -mno-cygwin option directs the code to link
against MSVCRT.DLL, so Cygwin is bypassed completely.
If you examine the Microsoft C runtime source, you'll see that
they explicitly check for a CTRL-Z as an end-of-file marker
if a file is opened in text mode. I think this behavior, along with
the LF to CRLF conversions, is an extension that is done by
Microsoft if you're in text mode.
I don't believe the Cygwin runtime treats CTRL-Z as a special case,
which explains the difference.
The CTRL-Z as EOF was a leftover from CP/M, but got propgated
into MSDOS/Windows.
Joe
--
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Bug reporting: http://cygwin.com/bugs.html
Documentation: http://cygwin.com/docs.html
FAQ: http://cygwin.com/faq/
More information about the Cygwin
mailing list