Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT sources DOT redhat DOT com Delivered-To: mailing list cygwin AT sources DOT redhat DOT com X-MimeOLE: Produced By Microsoft Exchange V6.0.4417.0 content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Subject: RE: Bug In Mount? (Bug in read()?) Date: Tue, 30 Jan 2001 13:16:11 -0800 Message-ID: <67677D360C1FD411BB4000B0D02080418031DE@eqexchange.equildom.equilibrium.com> Thread-Topic: Bug In Mount? (Bug in read()?) Thread-Index: AcCKXtbmzpl66YdhRAOBZCm56DvM+gAoPsmg From: "Josh Schulte" To: , Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id QAA21444 I don't think I have got all the details across. I don't see how it can not be bug. I take a computer. I remove the cygwin directory. I remove the cygwin registry entries. I install cygwin with a particular mount type (textmode or binmode). I run my test. I get the same results on both tests. I have done this on two seperate computers. Both computers give me the same results. In the mode that the \r is supposed to be stripped, it is not. The only way that this would not be a bug is if there is some extranious variable I have not accounted for that is changing the behaviour of cygwin or perl on my system. As far as I can tell, I have removed all extranious variables, I removed all traces of cygwin. Josh -----Original Message----- From: Earnie Boyd [mailto:earnie_boyd AT yahoo DOT com] Sent: Monday, January 29, 2001 5:46 PM To: Josh Schulte Cc: Earnie Boyd Subject: Re: Bug In Mount? (Bug in read()?) Josh Schulte wrote: > Correct me if I am wrong. \r\n are at the end of every line in a dos > text file. mounting stuff in binmode causes calls to the system call > read() to return the line as if there was only a \n at the end. mounting > stuff in textmode causes calls to the system call read() to return the > line as if there was only a \n at the end. If a file has DOS (\r\n) line endings and the fd is in binary mode the data will end with \r when read. If the fd is in text mode the data will not end with \r, the \r will have been removed and the count of characters read will be decremented by one. > > I am getting \r\n regardless of what mode I have the directories mounted > as when I read from perl, as demonstrated by the script below. I have > recreated the problem on two computers now. Can anyone else recreate > this problem? Is it a bug in cygwin? It's not a bug in Cygwin. I've already posted that I tried your example with the expected results. I suggest that the contents of your file contains DOS style line endings and the fd for the read is in binary mode. > > There is only one perl on my system. (Earnie: The /usr/local/bin/perl is > a link I create for backward compatability in some of my other scripts.) > I did a search of the entire system just to double check. So that is not > the problem. Ok, this shouldn't be a problem then. > > Thanks for any help, > Josh Earnie. > > > PERL SCRIPT > > ----------- > > > > #!/usr/local/bin/perl > > > > @what = split(/\n/, `cat contents`); > > > > foreach $line (@what) > > { > > print "***>$line<-\n"; > > } > > > > CONTENTS OF FILE > > ---------------- > > > > line one > > line two > > line three > > > MY RESULTS: > ----------- > <-*>line one > <-*>line two > <-*>line three > > -----Original Message----- > From: Earnie Boyd [mailto:earnie_boyd AT yahoo DOT com] > Sent: Thursday, January 25, 2001 2:13 PM > To: Josh Schulte > Cc: cygwin AT cygwin DOT com > Subject: Re: Bug In Mount?, Was [Odd/New Perl Behavior] > > Could be that you have \r\n in your contents file. Could be that you've > more than one version of perl installed. Note, the current perl is > located at /usr/bin/perl not /usr/local/bin/perl. > > Cheers, > Earnie. > > -- > Want to unsubscribe from this list? > Check out: http://cygwin.com/ml/#unsubscribe-simple _________________________________________________________ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.com -- Want to unsubscribe from this list? Check out: http://cygwin.com/ml/#unsubscribe-simple