From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id CAA28204; Fri, 13 Sep 2002 02:06:53 +0200 (MET DST) Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id CAA28232 for ; Fri, 13 Sep 2002 02:06:52 +0200 (MET DST) Received: from lithinos.com ([192.41.68.34]) by concorde.inria.fr (8.11.1/8.11.1) with ESMTP id g8D06p105202 for ; Fri, 13 Sep 2002 02:06:51 +0200 (MET DST) Received: from stone (42dbc309.dsl.aros.net [66.219.195.9]) by lithinos.com (8.12.5/8.11.0) with SMTP id g8D058km003930 for ; Thu, 12 Sep 2002 18:05:09 -0600 X-Authentication-Warning: lithinos.com: lought owned process doing -bs Message-ID: <000a01c25ab9$90a90200$0a00a8c0@stone> From: "Richard Lyman" To: Subject: [Caml-list] Setting the EOL character.... Date: Thu, 12 Sep 2002 18:07:35 -0600 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_0007_01C25A87.4592D250" X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.50.4807.1700 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4807.1700 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk This is a multi-part message in MIME format. ------=_NextPart_000_0007_01C25A87.4592D250 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable To start - I really don't know that much about programming (3 years = self-taught in scripted web languages - Perl/PHP/Ruby), and I'm trying = to learn OCaml... I've mostly dealt with persistent socket servers in other programming = languages, and I'd like to write one in OCaml. I've read most of the book - Developing Applications with Objective Caml = (English PDF), so I understand a little - but I'm still very unsure of = myself. Here's the problem I'm trying to solve... I have a proprietary format I'm trying to read in through a socket - = when I say proprietary I mean that the EOL character is the ASCII null = character (\000) and not the '\n' character. I've looked at the examples in the OReilly book, but I'm not sure how to = change the default End Of Line character (\n) to \000. Will I have to do some sort of pattern match on the stream so that I can = deal with 'each line' using \000 as the EOL character? Do the input, input_line, read, or read_line methods accept a different = EOL character as a parameter - or can I define the method differently? Since I can read in a certain amount of characters with methods like = read, can I find the location of the ASCII null character and read from = the stream until right after it? I hope I've asked good enough questions... Thanks for any help you guys can give! Let me know if anything's not clear enough... -Rich ------=_NextPart_000_0007_01C25A87.4592D250 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
To start - I really don't know that = much about=20 programming (3 years self-taught in scripted web languages - = Perl/PHP/Ruby), and=20 I'm trying to learn OCaml...
 
I've mostly dealt with persistent = socket servers in=20 other programming languages, and I'd like to write one in=20 OCaml.
 
I've read most of the book - Developing = Applications with Objective Caml (English PDF), so I understand a little = - but=20 I'm still very unsure of myself.
 
Here's the problem I'm trying to=20 solve...
 
I have a proprietary format I'm trying = to read in=20 through a socket - when I say proprietary I mean that the EOL character = is the=20 ASCII null character (\000) and not the '\n' character.
 
I've looked at the examples in the = OReilly book,=20 but I'm not sure how to change the default End Of Line character (\n) to = \000.
 
Will I have to do some sort of pattern = match on the=20 stream so that I can deal with 'each line' using \000 as the EOL=20 character?
 
Do the input, input_line, read, or = read_line=20 methods accept a different EOL character as a parameter - or can I = define the=20 method differently?
 
Since I can read in a certain amount of = characters=20 with methods like read, can I find the location of the ASCII null = character and=20 read from the stream until right after it?
 
I hope I've asked good enough=20 questions...
 
Thanks for any help you guys can = give!
 
Let me know if anything's not clear=20 enough...
 
-Rich
------=_NextPart_000_0007_01C25A87.4592D250-- ------------------- To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ Beginner's list: http://groups.yahoo.com/group/ocaml_beginners