Re: Happy christmas



vippstar@xxxxxxxxx wrote:
On Dec 26, 12:56 am, Joe Wright <joewwri...@xxxxxxxxxxx> wrote:
CBFalconer wrote:
jacob navia wrote:
Flash Gordon wrote:
... snip ...
Since you have opened the file in binary mode and MacOS 9.x and
earlier use '\r' as the line terminator you have just converted
the file to one long line on some systems.> >
Yes, will not work in DS9000 and MAC os9.x Easy to change though.
There is no portable way to know what line separator the system
uses.
Yes there is. Just open the file in text mode (i.e. without the
"rb") and wait until you detect a '\n' in the stream. That is
exactly where a line separator occured.
Not here. Opening a text file with CR line terminations in "r" mode is
fine but the CR bytes (0x0d) are never seen. I get one long line.
He is not talking about CR (which is ascii) or 0x0D which is just a
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 ---
.



Relevant Pages

  • Re: Apple II Graphics
    ... (we're not even talking about an RGB display here, ... the 7MHz bit stream can be considered ... All of the characteristics of Apple II video are a consequence of the ...
    (comp.sys.apple2)
  • Re: (DELETE-FILE open-file-stream)
    ... > How should DELETE-FILE behave on open file streams? ... I would have thought that, on Unix and Unixoid systems, this is a great ... *not* closing the stream, this is the semantics you'll get for free. ...
    (comp.lang.lisp)
  • Re: Apple II Graphics
    ... (we're not even talking about an RGB display here, ... the 7MHz bit stream can be considered ... All of the characteristics of Apple II video are a consequence of the ...
    (comp.sys.apple2)
  • Re: Binary or Ascii Text?
    ... You mean, before Unix developed a uniform notation for text streams, ... because the C stream is never ... and structured files -- if not always the same terminators. ... Many of those reasons have been subsumed into much ...
    (comp.lang.c)
  • Re: Apple TV Sales
    ... You install iTunes on your PC or Mac - the install is free. ... You can download your existing CDs to iTunes - no additional cost. ... Stream to Apple TV. ... You can purchase TV show episodes, 2 dollars an episode, stream to Apple ...
    (comp.sys.mac.advocacy)