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: Carriage Returns


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


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