Re: Happy christmas
- From: Joe Wright <joewwright@xxxxxxxxxxx>
- Date: Tue, 25 Dec 2007 21:19:46 -0500
vippstar@xxxxxxxxx wrote:
On Dec 26, 12:56 am, Joe Wright <joewwri...@xxxxxxxxxxx> wrote:CBFalconer wrote:He is not talking about CR (which is ascii) or 0x0D which is just ajacob navia wrote:Not here. Opening a text file with CR line terminations in "r" mode isFlash Gordon wrote:... snip ...Yes there is. Just open the file in text mode (i.e. without theSince you have opened the file in binary mode and MacOS 9.x andYes, will not work in DS9000 and MAC os9.x Easy to change though.
earlier use '\r' as the line terminator you have just converted
the file to one long line on some systems.> >
There is no portable way to know what line separator the system
uses.
"rb") and wait until you detect a '\n' in the stream. That is
exactly where a line separator occured.
fine but the CR bytes (0x0d) are never seen. I get one long line.
value, but '\n'.
Ok vippstar whoever you are. You weren't listening. Among the three systems, Apple, PC and Unix there are three line endings. Apple used a single CR, Unix a single LF and the PC two bytes, CRLF.
Jacob said "There is no portable way to know what line separator the system uses". Chuck said "Just open the file in text mode (i.e. without the "rb") and wait until you detect a '\n' in the stream".
My response to Chuck was that Hell will freeze over before a single CR in a text stream will be converted to LF for me to see (on my system here).
Do all of us the favor of assuming we know LF is '\n' and CR is '\r'. Now that you understand my reply to Chuck, please feel free to comment on it.
Before you attempt to correct me again, "CR is ascii but 0x0d is just a value" won't fly. You'll have to do better.
Merry Christmas
--
Joe Wright
"Everything should be made as simple as possible, but not simpler."
--- Albert Einstein ---
.
- Follow-Ups:
- Re: Happy christmas
- From: Richard Heathfield
- Re: Happy christmas
- From: Keith Thompson
- Re: Happy christmas
- From: vippstar
- Re: Happy christmas
- References:
- Happy christmas
- From: jacob navia
- Re: Happy christmas
- From: Flash Gordon
- Re: Happy christmas
- From: jacob navia
- Re: Happy christmas
- From: CBFalconer
- Re: Happy christmas
- From: Joe Wright
- Re: Happy christmas
- From: vippstar
- Happy christmas
- Prev by Date: Re: hi, what does over−indexd mean?
- Next by Date: Re: Making C better (by borrowing from C++)
- Previous by thread: Re: Happy christmas
- Next by thread: Re: Happy christmas
- Index(es):
Relevant Pages
|
|