caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Gerd Stolpmann <info@gerd-stolpmann.de>
To: Florent Monnier <monnier.florent@gmail.com>
Cc: Caml List <caml-list@inria.fr>
Subject: AW: [Caml-list] how to wrap a command line call correctly?
Date: Wed, 21 Nov 2012 23:41:10 +0100	[thread overview]
Message-ID: <1353537670.7241.15@samsung> (raw)
In-Reply-To: <CAE1DttDjgR37DRSJZ_L-exgx+rbepM3g_W4whajtNyGVWUdFoA@mail.gmail.com>

Am 21.11.2012 20:53:40 schrieb(en) Florent Monnier:
> Hi,
> 
> I would like to know how to wrap a command line call correctly?
> 
> I particular keep the same order of the output messages for stderr and
> stdout correctly, how to handle the cases when there is something on
> stdin or not, etc.

There is no way to keep the order of output messages, except you assign  
stdout and stderr to the same descriptor.

Otherwise, the Shell library included in Ocamlnet is your friend:

http://projects.camlcity.org/projects/dl/ocamlnet-3.6.1/doc/html-main/Shell.html

Especially, it can also be used in a synchronous environment (no need  
to tie yourself to Lwt), but async usage is also possible.

Shell takes advantage of the fast posix_spawn calls so far provided by  
the OS (e.g. on Linux and OS X), which means a significant speed  
advantage compare to fork+exec.

Gerd


> 
> Thanks
> 
> --
> 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
> 
> 

-- 
------------------------------------------------------------
Gerd Stolpmann, Darmstadt, Germany    gerd@gerd-stolpmann.de
Creator of GODI and camlcity.org.
Contact details:        http://www.camlcity.org/contact.html
Company homepage:       http://www.gerd-stolpmann.de
------------------------------------------------------------

      parent reply	other threads:[~2012-11-21 22:41 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-21 19:53 Florent Monnier
2012-11-21 21:19 ` Malcolm Matalka
2012-11-21 22:41 ` Gerd Stolpmann [this message]

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=1353537670.7241.15@samsung \
    --to=info@gerd-stolpmann.de \
    --cc=caml-list@inria.fr \
    --cc=gerd@edgespring.com \
    --cc=monnier.florent@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;
as well as URLs for NNTP newsgroup(s).