From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@sympa.inria.fr Delivered-To: caml-list@sympa.inria.fr Received: from mail1-relais-roc.national.inria.fr (mail1-relais-roc.national.inria.fr [192.134.164.82]) by sympa.inria.fr (Postfix) with ESMTPS id B517C7EDC2 for ; Wed, 21 Nov 2012 23:41:13 +0100 (CET) Received-SPF: None (mail1-smtp-roc.national.inria.fr: no sender authenticity information available from domain of info@gerd-stolpmann.de) identity=pra; client-ip=212.227.126.171; receiver=mail1-smtp-roc.national.inria.fr; envelope-from="info@gerd-stolpmann.de"; x-sender="info@gerd-stolpmann.de"; x-conformance=sidf_compatible Received-SPF: None (mail1-smtp-roc.national.inria.fr: no sender authenticity information available from domain of info@gerd-stolpmann.de) identity=mailfrom; client-ip=212.227.126.171; receiver=mail1-smtp-roc.national.inria.fr; envelope-from="info@gerd-stolpmann.de"; x-sender="info@gerd-stolpmann.de"; x-conformance=sidf_compatible Received-SPF: Pass (mail1-smtp-roc.national.inria.fr: domain of postmaster@moutng.kundenserver.de designates 212.227.126.171 as permitted sender) identity=helo; client-ip=212.227.126.171; receiver=mail1-smtp-roc.national.inria.fr; envelope-from="info@gerd-stolpmann.de"; x-sender="postmaster@moutng.kundenserver.de"; x-conformance=sidf_compatible; x-record-type="v=spf1" X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AnABAFNXrVDU436rlGdsb2JhbABEr1OSRBYOAQEBAQkLCQkUAySCHgEBBAE6NAsjHV0JEgYTCQmHaQMJCge1VQOJXhSMIIRjA41fhG2ETpIV X-IronPort-AV: E=Sophos;i="4.83,295,1352070000"; d="scan'208";a="182615351" Received: from moutng.kundenserver.de ([212.227.126.171]) by mail1-smtp-roc.national.inria.fr with ESMTP/TLS/RC4-SHA; 21 Nov 2012 23:41:13 +0100 Received: from office1.lan.sumadev.de (dslb-094-219-221-170.pools.arcor-ip.net [94.219.221.170]) by mrelayeu.kundenserver.de (node=mreu4) with ESMTP (Nemesis) id 0MXjQA-1TnuSk3mS6-00W2Vg; Wed, 21 Nov 2012 23:41:13 +0100 Received: from samsung (ip-5-146-55-186.unitymediagroup.de [5.146.55.186]) by office1.lan.sumadev.de (Postfix) with ESMTPSA id 70DF8C00CF; Wed, 21 Nov 2012 23:41:12 +0100 (CET) Date: Wed, 21 Nov 2012 23:41:10 +0100 From: Gerd Stolpmann Reply-To: Gerd Stolpmann To: Florent Monnier Cc: Caml List In-Reply-To: X-Mailer: Balsa 2.4.11 Message-Id: <1353537670.7241.15@samsung> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; DelSp=Yes; Format=Flowed Content-Disposition: inline Content-Transfer-Encoding: quoted-printable X-Provags-ID: V02:K0:XC982yq9BqGPfld7T2086GBc0D7lhBEhuqXBgoE33Jj 5QP3Ai/w2dFLastAQ1PmASTH5eTN2ODKHSbzVDgiop49GRTiQ1 pSPXE/vu6A69xGnDYlwmr0c0/p/wWIx0E9kbuMuqz2G+7+CtpA hguVgM7eyvUI6nYrqvLyKnYA3uKpokH5Rh2a+PpjU6NyhzSWsr AxrzYUZMScZafU/KXpeKcikdAbFJqT1CUeWHwAEHk+6Gv6twIb Y/vpouQkjEKjd+Mie2kHvtBDbVT5iQEKu2H2tq7jBs8mv3/1iM 3Pr/2jMWpVBrFJufkemg9RekkBFfFkbuyGsSUS2caML5oEj5YT 1uwjbSzJAyf8vRlNAD/M= Subject: AW: [Caml-list] how to wrap a command line call correctly? Am 21.11.2012 20:53:40 schrieb(en) Florent Monnier: > Hi, >=20 > I would like to know how to wrap a command line call correctly? >=20 > 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=20= =20 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=20=20 to tie yourself to Lwt), but async usage is also possible. Shell takes advantage of the fast posix_spawn calls so far provided by=20= =20 the OS (e.g. on Linux and OS X), which means a significant speed=20=20 advantage compare to fork+exec. Gerd >=20 > Thanks >=20 > -- > 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 >=20 >=20 --=20 ------------------------------------------------------------ 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 ------------------------------------------------------------=