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: TEXT mode, BINARY mode default file opening

At 03:24 AM 1/24/2005, you wrote:
>I am new to the list a have only been using CYGWIN for a few months.
>I would like to use the GNU compiler as a cross compiler for a Windoze
>machine and I am having problems with the files being opened in BINARY
>mode, I think.
>I have the whole system running on Windoze 2000 using an old version of
>CYGWIN circa version 1.5.5, it all works perfectly but when I try and
>install it on a Windoze XP machine it CYGWIN falls over with a heap
>allocation error. So, looking at the FAQ etc I learn that I need the new
>version of CYGWIN.
>I install the latest version of CYGWIN on my Windoze XP machine and I
>have no heap problems but what I get now is 'Invalid token in
>expression' errors from the compiler on lines of code that wrap past the
>carriage return. I understand that this is due to the way in which MSDOS
>and UNIX text files are stored. Anyway looking at the FAQ etc, I find
>that there is an environmental variable CYGWIN which if I make
>=nobinmode it will not open the files in BINARY. Well sure enough if I
>run CYGWIN and type mount all my mounts are in TEXT mode. But the
>compiler still doesn't work. Looking deeper, I find that the latest
>versions of CYGWIN default to BINARY and older ones TEXT mode. This I
>think explains it. But how do I get the compiler to open the files in
>TEXT mode.
>This is what I think is happening. The compiler is being activated from
>JAVA application which is creating an MSDOS shell. When the compiler is
>called, the CYGWIN DLL loads, when this happens will the CYGWIN
>environment variable be used? I also have found information that says is
>the path called is explicit with a drive letter for example, then the
>opening mode will be BINARY. Can this be changed to TEXT?
>Unfortunately I can't change all the files to remove the extra carriage
>returns or line feeds as the files are used by other programs. So I
>think my options are:
>1. Try and find a way of CYGWIN to open the files correctly (if indeed
>it is caused by CYGWIN, note I don't say problem with CYGWIN)
>2. Try and find an intermediate version of CYGWIN, I think 1.5.9 has the
>XP heap fixed but not the default mount mode changed.
>3. Recompile the compiler with --no-cygwin, will this allow it to work
>in Windozes without CYGWIN?
>4. Recompile the compiler with a windows compiler so as to make it a
>native windoze application.
>Well, thanks for reading all that, I hope some of you out there have
>some good thoughts, and ideas for me to try.

Why don't you try mounting your source directory in cygwin as "text" and
then use 'cygpath -u' on the files that you're passing to gcc?  This will
make Cygwin use the mode specified by mount.

Larry Hall                    
RFK Partners, Inc.                      (508) 893-9779 - RFK Office
838 Washington Street                   (508) 893-9889 - FAX
Holliston, MA 01746                     

Unsubscribe info:
Problem reports:

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]