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 mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by sympa.inria.fr (Postfix) with ESMTPS id A5D047F60B for ; Fri, 24 Mar 2017 10:05:17 +0100 (CET) Authentication-Results: mail3-smtp-sop.national.inria.fr; spf=None smtp.pra=Kim.Nguyen@lri.fr; spf=None smtp.mailfrom=Kim.Nguyen@lri.fr; spf=None smtp.helo=postmaster@ext.lri.fr Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of Kim.Nguyen@lri.fr) identity=pra; client-ip=129.175.15.4; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="Kim.Nguyen@lri.fr"; x-sender="Kim.Nguyen@lri.fr"; x-conformance=sidf_compatible Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of Kim.Nguyen@lri.fr) identity=mailfrom; client-ip=129.175.15.4; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="Kim.Nguyen@lri.fr"; x-sender="Kim.Nguyen@lri.fr"; x-conformance=sidf_compatible Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of postmaster@ext.lri.fr) identity=helo; client-ip=129.175.15.4; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="Kim.Nguyen@lri.fr"; x-sender="postmaster@ext.lri.fr"; x-conformance=sidf_compatible IronPort-PHdr: =?us-ascii?q?9a23=3Abcc2uRDfGR18a0XZ3O+bUyQJP3N1i/DPJgcQr6Af?= =?us-ascii?q?oPdwSPr+osbcNUDSrc9gkEXOFd2CrakV16yO6+jJYi8p2d65qncMcZhBBVcuqP?= =?us-ascii?q?49uEgeOvODElDxN/XwbiY3T4xoXV5h+GynYwAOQJ6tL1LdrWev4jEMBx7xKRR6?= =?us-ascii?q?JvjvGo7Vks+7y/2+94fdbghMizexe69+IAmrpgjNq8cahpdvJLwswRXTuHtIfO?= =?us-ascii?q?pWxWJsJV2Nmhv3+9m98p1+/SlOovwt78FPX7n0cKQ+VrxYES8pM3sp683xtBnM?= =?us-ascii?q?VhWA630BWWgLiBVIAgzF7BbnXpfttybxq+Rw1DWGMcDwULs5Xymp4aV2Rx/ykC?= =?us-ascii?q?oINTA5/mHZhMJzkaxVvg6uqgdjw4LIeoyZKOZycr/fcN4cWGFPXtxRVytEAo6k?= =?us-ascii?q?aoUPDu8BNvtAoYnyulsPrQC5BQ+xD+7ozzFIh3r20bci3eQuDAHH3BIvH9QVvX?= =?us-ascii?q?TQttX1Nb0eUe6vzKTRyzjIcvBY2S/l5YTVbBwspeuAUa9yfMfR00UjCgPIgk+f?= =?us-ascii?q?pIHjIjibzP4Cs3KB4OplTe+vi3AoqwV2ojW32MgthZXJipgRylDe9CV12og1Jc?= =?us-ascii?q?egRE56Z96rDodQujmHO4doRs4uWXxktSQ6x7EcpJK2fDIGxZs/yx7acfOHcoyI?= =?us-ascii?q?4hz5VOaWJDd1nHdreLO6hxqo6UagxfD8V8mq31ZMtSdFlsPMtnEX2xzd8MiLUu?= =?us-ascii?q?F98Vu52TaTywDT7flJLlwumqreL54t27owlpsIsUTfBSL2g0X3jKqOdko+4OSo?= =?us-ascii?q?6uLnYq/nppCGLYN0hBv+YewSnZmnCPk8dAwHVGiS5cyx2KCl4Ev4XvBEhfozjq?= =?us-ascii?q?SfvoqJC94co/uaAgod9Ik++pS5R2OF0dFeu3YaPV9DUBadjs7nIQedc7jDEf6j?= =?us-ascii?q?jgH0w39QzPfcM+i5Dw=3D=3D?= X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: =?us-ascii?q?A0DxAwDd4NRYYQQPr4FdGwEBAQMBAQEJA?= =?us-ascii?q?QEBFQEBAQECAQEBAQgBAQEBgyZREIELB4Nbm12XVyKGAAKDGAdCFQEBAQEBAQE?= =?us-ascii?q?BAQEBBRgWBlmCMyCCQwEFI1YQCwsNAgImAgIiEwUdGYoGBak3giaKRAEBCAEBA?= =?us-ascii?q?QEBI4ELijKFIII6gl8BBJxZa4YQi1CCUIgKhlaSMYEyAjWBJl1SFwaGPHQBiW0?= =?us-ascii?q?BAQE?= X-IPAS-Result: =?us-ascii?q?A0DxAwDd4NRYYQQPr4FdGwEBAQMBAQEJAQEBFQEBAQECAQE?= =?us-ascii?q?BAQgBAQEBgyZREIELB4Nbm12XVyKGAAKDGAdCFQEBAQEBAQEBAQEBBRgWBlmCM?= =?us-ascii?q?yCCQwEFI1YQCwsNAgImAgIiEwUdGYoGBak3giaKRAEBCAEBAQEBI4ELijKFIII?= =?us-ascii?q?6gl8BBJxZa4YQi1CCUIgKhlaSMYEyAjWBJl1SFwaGPHQBiW0BAQE?= X-IronPort-AV: E=Sophos;i="5.36,214,1486422000"; d="scan'208";a="217880345" Received: from ext.lri.fr ([129.175.15.4]) by mail3-smtp-sop.national.inria.fr with ESMTP; 24 Mar 2017 10:04:53 +0100 Received: from [129.175.15.4] (ext.lri.fr [129.175.15.4]) by ext.lri.fr (Postfix) with ESMTP id 704A940B42 for ; Fri, 24 Mar 2017 10:04:53 +0100 (CET) Received: from [129.175.15.4] (ext.lri.fr [129.175.15.4]) by localhost (ext.lri.fr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id yzdYXXQnHOTv for ; Fri, 24 Mar 2017 10:04:53 +0100 (CET) Received: from [129.175.15.4] (ext.lri.fr [129.175.15.4]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ext.lri.fr (Postfix) with ESMTPSA id 205AB40B20 for ; Fri, 24 Mar 2017 10:04:53 +0100 (CET) Received: by mail-ot0-f182.google.com with SMTP id a12so5035150ota.0 for ; Fri, 24 Mar 2017 02:04:53 -0700 (PDT) X-Gm-Message-State: AFeK/H2O89+AgRuIDrWC4nDk6JGIWDK2/L71T+LFRl9FKLO4FKeFVF/lCIvhlkvG5IQobNjzbLksBWiYOBgPYQ== X-Received: by 10.157.62.70 with SMTP id h6mr2585823otg.134.1490346291962; Fri, 24 Mar 2017 02:04:51 -0700 (PDT) MIME-Version: 1.0 Received: by 10.202.245.205 with HTTP; Fri, 24 Mar 2017 02:04:11 -0700 (PDT) In-Reply-To: <1590236478.9253508.1490261850094.JavaMail.zimbra@edu.univ-fcomte.fr> References: <1590236478.9253508.1490261850094.JavaMail.zimbra@edu.univ-fcomte.fr> From: =?UTF-8?B?S2ltIE5ndXnhu4Vu?= Date: Fri, 24 Mar 2017 10:04:11 +0100 X-Gmail-Original-Message-ID: Message-ID: To: paul.lachat@edu.univ-fcomte.fr Cc: "caml-list@inria.fr" Content-Type: text/plain; charset=UTF-8 X-Validation-by: kim.nguyen@lri.fr Subject: Re: [Caml-list] [Question] Loading .ml in memory to interact with them. On Thu, Mar 23, 2017 at 10:37 AM, wrote: > Hello, > > > But when I send the first instruction (ex : #use "file.ml";;\n), the ocaml > process send back the response and stop. > The problem here is that echo (or printf) closes the pipe_in fifo, hence sending EOF to the ocaml toplevel. You need to force the fifo to somehow remain open. tail -f /tmp/pipe_in | ocaml > /tmp/pipe_out in another terminal, echo to /tmp/pipe_in, and tail -f /tmp/pipe_out to see the result. Or a small ocaml program that open_out /tmp/pipe_in and copies its standard input without closing /tmp/pipe_in (but flushing it explicitely to be sure each line is sent as soon as possible) : let () = let oc = open_out "/tmp/pipe_in" in while true do let s = read_line () in output_string oc s; output_char oc '\n'; flush oc done (catch exceptions where appropriate !). Hope this helps, -- Kim