delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2004/06/18/16:22:53

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
MIME-Version: 1.0
Subject: RE: Carriage Returns
Date: Fri, 18 Jun 2004 13:17:07 -0700
Message-ID: <7D036BD3216A084DB1BD9D62BCEAF29049A436@mail1irv.inside.istor.com>
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
From: "Chris Carlson" <ccarlson AT istor DOT com>
To: <cygwin AT cygwin DOT com>
X-IsSubscribed: yes
X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id i5IKMooO023629

-----Original Message-----
[snip]

I just really, really, *really* don't think that _anything_ is going to
work
around the issue that if you strip all the newlines from a CRLF
terminated
file[+], what you end up with is something that won't be any good for
either
'doze ~OR~ *nix!

Apart from maybe _not_ stripping all the newlines, perhaps?

The best workaround would be to get an Amiga or Mac... they're the only
systems that use CR lineends!
-----Original Message-----

I just have to butt in, though it's none of my business.

There are many times when one wants to read a line from a file and strip
carriage-returns and line-feeds.  I don't know Perl like the back of my
hand, but I seem to remember there is even a special feature/function
that is supposed to do it.

In C, I usually programmatically check for both carriage returns and
line feeds and replace them with '\0'.  I only do this because M$ uses
both.  I never had to worry about it in *nix-land.

As defined in C, there is a concept of "end-of-line character."  I was
under the impression that Perl understood this concept, too.  It just so
happens that M$ doesn't have one end-of-line character, but a pair of
them.  In some scripting languages, the carriage-return/line-feed pair
is considered one end-of-line character and removing one removes both.

It would be logical to assume that a function that removes the
end-of-line character on a M$ box would remove both the carriage-return
and the line-feed.  I think this is what Mr. Kramer is trying to say.


--
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/


- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019