caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] Logging to a channel form C
@ 2016-06-12 12:29 Sébastien Hinderer
  2016-06-12 12:32 ` Sébastien Hinderer
  0 siblings, 1 reply; 4+ messages in thread
From: Sébastien Hinderer @ 2016-06-12 12:29 UTC (permalink / raw)
  To: caml-list

Dear all,

Assuming a channel chan has been opened with open_out, is there a
recommended way to write to the underlying file from a C program?

Is it a matter of passing chan to the C program and then extracting the
file descriptor with the help of "caml/io.h" ?

Thanks,

Sébastien.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Caml-list] Logging to a channel form C
  2016-06-12 12:29 [Caml-list] Logging to a channel form C Sébastien Hinderer
@ 2016-06-12 12:32 ` Sébastien Hinderer
  2016-06-12 18:10   ` Gabriel Scherer
  0 siblings, 1 reply; 4+ messages in thread
From: Sébastien Hinderer @ 2016-06-12 12:32 UTC (permalink / raw)
  To: caml-list

Btw Unix library not allowed in the use case.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Caml-list] Logging to a channel form C
  2016-06-12 12:32 ` Sébastien Hinderer
@ 2016-06-12 18:10   ` Gabriel Scherer
  2016-06-12 20:27     ` Sébastien Hinderer
  0 siblings, 1 reply; 4+ messages in thread
From: Gabriel Scherer @ 2016-06-12 18:10 UTC (permalink / raw)
  To: Sébastien Hinderer, caml users

I would call the channel-writing functions of the OCaml runtime, see
byterun/caml/io.h (and <caml/io.h> for C includes).

On Sun, Jun 12, 2016 at 8:32 AM, Sébastien Hinderer
<Sebastien.Hinderer@inria.fr> wrote:
> Btw Unix library not allowed in the use case.
>
> --
> Caml-list mailing list.  Subscription management and archives:
> https://sympa.inria.fr/sympa/arc/caml-list
> Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
> Bug reports: http://caml.inria.fr/bin/caml-bugs

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Caml-list] Logging to a channel form C
  2016-06-12 18:10   ` Gabriel Scherer
@ 2016-06-12 20:27     ` Sébastien Hinderer
  0 siblings, 0 replies; 4+ messages in thread
From: Sébastien Hinderer @ 2016-06-12 20:27 UTC (permalink / raw)
  To: Gabriel Scherer; +Cc: caml users

Gabriel Scherer (2016/06/12 14:10 -0400):
> I would call the channel-writing functions of the OCaml runtime, see
> byterun/caml/io.h (and <caml/io.h> for C includes).

Ah, I see, thanks. This would indeed guarantee coherent output, but then
it also means that one has to sprintf to a string before writing to the
channel, right?

Thanks,

Sébastien.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2016-06-12 20:27 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-06-12 12:29 [Caml-list] Logging to a channel form C Sébastien Hinderer
2016-06-12 12:32 ` Sébastien Hinderer
2016-06-12 18:10   ` Gabriel Scherer
2016-06-12 20:27     ` Sébastien Hinderer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).