Mailing list for all users of the OCaml language and system.
 help / color / mirror / Atom feed
From: "Richard Lyman" <rich@lithinos.com>
To: <caml-list@inria.fr>
Subject: [Caml-list] Setting the EOL character....
Date: Thu, 12 Sep 2002 18:07:35 -0600	[thread overview]
Message-ID: <000a01c25ab9$90a90200$0a00a8c0@stone> (raw)

[-- Attachment #1: Type: text/plain, Size: 1395 bytes --]

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

[-- Attachment #2: Type: text/html, Size: 2836 bytes --]

             reply	other threads:[~2002-09-13  0:06 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-09-13  0:07 Richard Lyman [this message]
2002-09-13  2:24 Arturo Borquez
2002-09-13  2:36 ` Richard Lyman
2002-09-13  9:10   ` Alessandro Baretta
2002-09-13 15:33   ` Bruno.Verlyck
2002-09-13 15:52     ` Matt Boyd

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='000a01c25ab9$90a90200$0a00a8c0@stone' \
    --to=rich@lithinos.com \
    --cc=caml-list@inria.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox