From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by c5ff346549e7 (Postfix) with ESMTPS id 494355D5 for ; Sat, 9 Jan 2021 16:45:17 +0000 (UTC) X-IronPort-AV: E=Sophos;i="5.79,334,1602540000"; d="scan'208,217";a="486246330" Received: from prod-listesu18.inria.fr (HELO sympa.inria.fr) ([128.93.162.160]) by mail2-relais-roc.national.inria.fr with ESMTP; 09 Jan 2021 17:45:15 +0100 Received: by sympa.inria.fr (Postfix, from userid 20132) id 3F351E6FE3; Sat, 9 Jan 2021 17:45:15 +0100 (CET) Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by sympa.inria.fr (Postfix) with ESMTPS id 2F668E6B59 for ; Sat, 9 Jan 2021 17:45:09 +0100 (CET) Authentication-Results: mail2-smtp-roc.national.inria.fr; spf=None smtp.pra=Xavier.Leroy@inria.fr; spf=Pass smtp.mailfrom=xavier.leroy@gmail.com; spf=None smtp.helo=postmaster@mail-wr1-f50.google.com IronPort-PHdr: =?us-ascii?q?9a23=3A370CiBHhdSJvFXFBD/AP6J1GYnF86YWxBRYc798d?= =?us-ascii?q?s5kLTJ7zos6wAkXT6L1XgUPTWs2DsrQY0rWQ6fy/EjJdqb+681k6OKRWUBEEjc?= =?us-ascii?q?hE1ycBO+WiTXPBEfjxciYhF95DXlI2t1uyMExSBdqsLwaK+i764jEdAAjwOhRo?= =?us-ascii?q?LerpBIHSk9631+ev8JHPfglEnjWwba5wIRmsswncucsbjYRjJ6sx1xDEvmZGd+?= =?us-ascii?q?NKyG1yOFmdhQz85sC+/J5i9yRfpfcs/NNeXKv5Yqo1U6VWACwpPG4p6sLrswLD?= =?us-ascii?q?TRaU6XsHTmoWiBtIDBPb4xz8Q5z8rzH1tut52CmdIM32UbU5Uims4qt3VBPljj?= =?us-ascii?q?oMOjgk+2/Vl8NwlrpWrx2vpxN9w4DaboK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ONiOT1mi?= =?us-ascii?q?T5OtBjRjFotgke9LWF50HpCZtj6G2iOrB7EPkLnSXc4796vd2z76IMMvkns=3D?= X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: =?us-ascii?q?A0A3AgB43PlffzLdVdFihXlXMxcXhD+BH?= =?us-ascii?q?pAgihyKA4goAQMBDSUKBAEBhAaCNgIdBwEENBMCEAEBBQEBAQIBAwMEARMBAQ0?= =?us-ascii?q?LCwgnhWoMgjgigxkBAQEDARIRMCsLCwQHDSoCAiEBEgEFARwGEyKDBYJVAw4gD?= =?us-ascii?q?6BBgQQ9ij52gTKIJQ0VTYE8BhKBJoZyAYY+Jg+BTT+BR4I1Lj6CG0IEhHWCYAS?= =?us-ascii?q?DeQICgQMSMwSbapxvLCwHgVuBH4EcC4gEjReFHSKiYJ8ogniOWIRzECOBSoF6M?= =?us-ascii?q?xonTDEGgjJQGQ2OWIhOhUVDMAI1AgYBCQEBAwmNUgEB?= X-IPAS-Result: =?us-ascii?q?A0A3AgB43PlffzLdVdFihXlXMxcXhD+BHpAgihyKA4goAQM?= =?us-ascii?q?BDSUKBAEBhAaCNgIdBwEENBMCEAEBBQEBAQIBAwMEARMBAQ0LCwgnhWoMgjgig?= =?us-ascii?q?xkBAQEDARIRMCsLCwQHDSoCAiEBEgEFARwGEyKDBYJVAw4gD6BBgQQ9ij52gTK?= =?us-ascii?q?IJQ0VTYE8BhKBJoZyAYY+Jg+BTT+BR4I1Lj6CG0IEhHWCYASDeQICgQMSMwSba?= =?us-ascii?q?pxvLCwHgVuBH4EcC4gEjReFHSKiYJ8ogniOWIRzECOBSoF6MxonTDEGgjJQGQ2?= =?us-ascii?q?OWIhOhUVDMAI1AgYBCQEBAwmNUgEB?= X-IronPort-AV: E=Sophos;i="5.79,334,1602540000"; d="scan'208,217";a="486246303" X-MGA-submission: =?us-ascii?q?MDEPMOHX3jyWqWiiHQJTQSYyfyRpxE8n8n1VoF?= =?us-ascii?q?VZKSh8wRxJVUN4fr5JmqDkkpi+K1PbuYYplOz9sFqrEvAw0/9jfRlCtR?= =?us-ascii?q?cgaZQ43mD7kActoEpgg+kTEMFlt2UPkUp8/8J4Hbh/wQLId+kQKFGNDl?= =?us-ascii?q?Zv23a2+wIO1d573MoEecAlPQ=3D=3D?= Received: from mail-wr1-f50.google.com ([209.85.221.50]) by mail2-smtp-roc.national.inria.fr with ESMTP/TLS/AES256-GCM-SHA384; 09 Jan 2021 17:45:08 +0100 Received: by mail-wr1-f50.google.com with SMTP id t16so11984702wra.3 for ; Sat, 09 Jan 2021 08:45:08 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=XHHr0AlYS9AFKvrLKUVlqFBc+DsigRVFKSgXn2z2oBg=; b=Z/pUcFelMmN7xXoCTWtEjWdYxaEnBjE2VJsTwdg9MF+E8tHK+9iK/SxVU/nL2nLlpe 4j/PgKl3olfon5hYP6Zpic/qWd3ggFIl61CT0qAWVFAAq01kCk4bawW+m3M8IbRYBGhh q8aZ2I1LJq7P/DJkLk5wFbLO3yYlwD8hHAetydndHLM/8ixDg5sO+Ys3FuLTuoBOdzGu rQfnIcX55GS2PGqCaeh2pXlHcgdM5B69EPITr0kpvMetDATxRMUK1ueKZXMeOiJyEV3V PTDUuL+lzFSeCiggxSPdFgIOU2aveLX91QzHekc57fODaTdxSoydQUKKAxw+iN3moPz2 sQ3g== X-Gm-Message-State: AOAM531mSSpfrA6WFszssHcaweUytyp+tmrmvPqEb06NDNXqdNdiJt6K LGw0g1QI0lcFXgZbI5pR19XRND/Ggt13oo81wdYgJUIwf1s= X-Google-Smtp-Source: ABdhPJyoMRnfv+7VJVTChpozWxWCijEcL4efpl2IppdlDWCQs8aeSVFIeinbtb6y3SHxsoWxZPSdHW1b3oxxUFk3WMU= X-Received: by 2002:adf:92a4:: with SMTP id 33mr8666640wrn.347.1610210707717; Sat, 09 Jan 2021 08:45:07 -0800 (PST) MIME-Version: 1.0 References: <784c4a4e-96ae-d478-4116-b2f6e8fd8c7a@web.de> In-Reply-To: From: Xavier Leroy Date: Sat, 9 Jan 2021 17:44:41 +0100 Message-ID: To: caml users Content-Type: multipart/alternative; boundary="0000000000003f3f3e05b87a6593" Subject: Re: [Caml-list] Determination of the identification for the last started background process Reply-To: Xavier Leroy X-Loop: caml-list@inria.fr X-Sequence: 18354 Errors-To: caml-list-owner@inria.fr Precedence: list Precedence: bulk Sender: caml-list-request@inria.fr X-no-archive: yes List-Id: List-Help: List-Subscribe: List-Unsubscribe: List-Post: List-Owner: List-Archive: Archived-At: --0000000000003f3f3e05b87a6593 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Sat, Jan 9, 2021 at 5:34 PM Gabriel Scherer wrote: > My understanding is that if "prog" is the name of the program to run, the= n > > Unix.system (Filename.quote_command prog args) > > is equivalent to > > Unix.create_process prog args ~stdin:Unix.stdin ~stdout:Unix.stdout > ~stderr:Unix.stderr > Not quite: args should be Array.of_list (prog :: args). Argument number 0 is, by Unix convention, the name of the program. The original poster may be looking for the Unix.open_process family of functions. - Xavier Leroy > or (shorter) > > Unix.(create_process prog args ~stdin ~stdour ~stderr) > > On Sat, Jan 9, 2021 at 5:08 PM Markus Elfring > wrote: > >> > You may be looking for the >> > >> > Unix.create_process >> >> This function needs more input parameters than =E2=80=9CUnix.system=E2= =80=9D. >> >> https://ocaml.org/releases/4.11/htmlman/libref/UnixLabels.html#VALcreate= _process >> >> Now I am curious which datum should be passed for the argument =E2=80=9C= stdin=E2=80=9D >> if a program should be executed as a child process without extra standar= d >> input? >> >> Regards, >> Markus >> > --0000000000003f3f3e05b87a6593 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
On Sat, Jan 9, 2021 at 5:34 PM Gabriel Scherer <gabriel.scherer@gmail.com> wrote:
= My understanding is that if "prog" is the name of the program to = run, then

=C2=A0 Unix.system (Filename.quote_c= ommand prog args)

is equivalent to
<= br>
=C2=A0 Unix.create_process prog args ~stdin:Unix.stdin ~stdou= t:Unix.stdout ~stderr:Unix.stderr

Not quite: args should be <= span style=3D"font-family:monospace">Array.of_list (prog :: args).= =C2=A0 Argument number 0 is, by Unix convention, the name of the program.

The original poster may be looking for the Unix.open_process family of functi= ons.

- Xavier Leroy


<= /div>


or (shorter)

= =C2=A0 Unix.(create_process prog args ~stdin ~stdour ~stderr)

On S= at, Jan 9, 2021 at 5:08 PM Markus Elfring <Markus.Elfring@web.de> wrote:
> You may be looking = for the
>
> =C2=A0 Unix.create_process

This function needs more input parameters than =E2=80=9CUnix.system=E2=80= =9D.
https://ocaml.org/re= leases/4.11/htmlman/libref/UnixLabels.html#VALcreate_process

Now I am curious which datum should be passed for the argument =E2=80=9Cstd= in=E2=80=9D
if a program should be executed as a child process without extra standard i= nput?

Regards,
Markus
--0000000000003f3f3e05b87a6593--