Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com X-Info: This message was accepted for relay by smtp03.mrf.mail.rcn.net as the sender used SMTP authentication X-Trace: UmFuZG9tSVb7O+qFxASiJH9YJq8+U0BpVyYmXJ4mxiC5gj9/WvJSlO/B58yGm0ih Message-ID: <3F313B83.2090601@cygwin.com> Date: Wed, 06 Aug 2003 13:31:47 -0400 From: Larry Hall Reply-To: cygwin AT cygwin DOT com User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.4) Gecko/20030624 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Francis Harvey CC: "'cygwin AT cygwin DOT com'" Subject: Re: Install 1.3.22-1 problem - default text file type - DOS References: <9B501B3774931C469BCCCC021BE5372277AD5F AT remailnt2-re01 DOT westat DOT com> In-Reply-To: <9B501B3774931C469BCCCC021BE5372277AD5F@remailnt2-re01.westat.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit You need to rebuild byacc changing O_BINARY to O_TEXT and "rb"/"wb" to "rt"/"wt" for open/fopen calls. Larry Francis Harvey wrote: > Greetings, > > I realize most people may not be familiar with the byacc package, but > it can't hurt to ask. I would like to alter the behavior of byacc to > make the file pointer yyin use this "text" mode by default. I can > always reopen the pointer myself in the correct mode, but it would be > nice to know whether or not there is an option to already accomplish > this. For now, I will assume I have to reopen the pointer to take > advantage of the technique below. > > Francis R. Harvey III > WB303, x3952 > harveyf1 AT westat DOT com > > VB programmers know the wisdom of Nothing > > >>-----Original Message----- >>From: Larry Hall [mailto:cygwin-lh AT cygwin DOT com] >>Sent: Tuesday, August 05, 2003 5:31 PM >>To: Brian Dessent >>Cc: 'cygwin AT cygwin DOT com' >>Subject: Re: Install 1.3.22-1 problem - default text file type - DOS >> >> >>Brian Dessent wrote: > > > >>>But that completely misses the point of "text" mode. You >> >>should always >> >>>use just "\n" in your strings in the source code, and open any files >>>containing text in "text" mode i.e. fopen("foo", "rt"). >> >>That way, when >> >>>you read and write to the file "\n" will be converted to >> >>"\r\n" by the >> >>>io library, but your code will be portable to any other >> >>posix system. >> >>>If you explicitly use "\r\n" in your program then you have >> >>to make sure >> >>>the file is always opened in binary mode otherwise you'll could get >> >> ^^^^^^ >> opened and _written_ >> >>>"\r\r\n" as your line delimiter. >>> >>>Brian >> >> >>-- >>Larry Hall http://www.rfk.com >>RFK Partners, Inc. (508) 893-9779 - RFK Office >>838 Washington Street (508) 893-9889 - FAX >>Holliston, MA 01746 >> -- 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/