From: Gerd Stolpmann <info@gerd-stolpmann.de>
To: Martin DeMello <martindemello@gmail.com>
Cc: OCaml List <caml-list@yquem.inria.fr>
Subject: Re: [Caml-list] wrapping a string in an in_channel
Date: Sun, 05 Jan 2014 10:49:52 +0100 [thread overview]
Message-ID: <1388915392.2999.26.camel@e130> (raw)
In-Reply-To: <CAFrFfuGJ1RfPo9vOx_psAszQO-Lq=J351qC+TGeWAZzv+=aJCQ@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 930 bytes --]
Am Sonntag, den 05.01.2014, 00:23 -0800 schrieb Martin DeMello:
> Does OCaml have any equivalent to ruby's StringIO, to wrap an
> in_channel around a string and then treat it as if it were a file?
With the standard library this is not possible.
When I need such a feature, I normally use OCamlnet's channel objects:
http://projects.camlcity.org/projects/dl/ocamlnet-3.7.3/doc/html-main/Netchannels_tut.html
http://projects.camlcity.org/projects/dl/ocamlnet-3.7.3/doc/html-main/Netchannels.html
http://www.ocaml-programming.de/rec/IO-Classes.html
Gerd
--
------------------------------------------------------------
Gerd Stolpmann, Darmstadt, Germany gerd@gerd-stolpmann.de
My OCaml site: http://www.camlcity.org
Contact details: http://www.camlcity.org/contact.html
Company homepage: http://www.gerd-stolpmann.de
------------------------------------------------------------
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 490 bytes --]
next prev parent reply other threads:[~2014-01-05 9:49 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-01-05 8:23 Martin DeMello
2014-01-05 9:49 ` Gerd Stolpmann [this message]
2014-01-05 14:23 ` Hezekiah M. Carty
2014-01-06 10:32 ` John Whitington
2014-01-07 21:02 ` Stéphane Glondu
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=1388915392.2999.26.camel@e130 \
--to=info@gerd-stolpmann.de \
--cc=caml-list@yquem.inria.fr \
--cc=martindemello@gmail.com \
/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