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 mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by sympa.inria.fr (Postfix) with ESMTPS id 6E5617FA5F for ; Mon, 16 Jan 2017 15:30:59 +0100 (CET) Authentication-Results: mail2-smtp-roc.national.inria.fr; spf=None smtp.pra=helmut.brandl@gmx.net; spf=Pass smtp.mailfrom=helmut.brandl@gmx.net; spf=None smtp.helo=postmaster@mout.gmx.net Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of helmut.brandl@gmx.net) identity=pra; client-ip=212.227.15.19; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="helmut.brandl@gmx.net"; x-sender="helmut.brandl@gmx.net"; x-conformance=sidf_compatible Received-SPF: Pass (mail2-smtp-roc.national.inria.fr: domain of helmut.brandl@gmx.net designates 212.227.15.19 as permitted sender) identity=mailfrom; client-ip=212.227.15.19; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="helmut.brandl@gmx.net"; x-sender="helmut.brandl@gmx.net"; x-conformance=sidf_compatible; x-record-type="v=spf1" Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of postmaster@mout.gmx.net) identity=helo; client-ip=212.227.15.19; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="helmut.brandl@gmx.net"; x-sender="postmaster@mout.gmx.net"; x-conformance=sidf_compatible IronPort-PHdr: =?us-ascii?q?9a23=3Awl3QGBXzUHXL8p2RHCcyXWEghSHV8LGtZVwlr6E/?= =?us-ascii?q?grcLSJyIuqrYZhKOt8tkgFKBZ4jH8fUM07OQ6PG8Hzddqs/R7zhCKMUKDEBVz5?= =?us-ascii?q?1O3kQJO42sNw7SFLbSdSs0HcBPBhdO3kqQFgxrIvv4fEDYuXao7DQfSV3VPAtx?= =?us-ascii?q?IfnpSMaJ15zkn8j7wZDYYh1JiTyhevsyaUzu9USCgPILmpNvIbodzR7Ao30AO7?= =?us-ascii?q?gHhDAgGVXGpxb94sao5JMrzSlatuhpo9ZAUKH7Z7w1C6JVBjk8G28w7czv8xLE?= =?us-ascii?q?SF3c3HYEVnQqlU9IDgzA8Q28VI34tCf+nuV4yG+cMNGlY6ozXGGC4qNuVQOgoj?= =?us-ascii?q?0OMTI9uDXXh8h1kb4dqgiooRB764HRcMeTOeYoLfCVRs8TWWcUBpUZbCdGGI7p?= =?us-ascii?q?KtZWAg=3D=3D?= X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: =?us-ascii?q?A0AuDwCN2HxYhxMP49RdGQEBAQEBAQEBA?= =?us-ascii?q?QEBBwEBAQEBFAEBAQEBAQEBAQEBBwEBAQEBgw4BAQEBAX6BCQeDSooHhzQZiki?= =?us-ascii?q?CNpJ2ggsqhXgCghMHPxgBAQEBAQEBAQEBARIBAQEIDQkKHTCCMwQBFgWCFgEBA?= =?us-ascii?q?QMBI0sLBQsLCw0NHQICHgMBDQUBBQEKEgYTEohVAQECEAgECqIJP4wDgiWEaIF?= =?us-ascii?q?1ASYBIwMKgkwBAQEBAQEEAQEBAQEBIoZFhGeCUIREOoJeBYckDIhxhQ6FUw0rg?= =?us-ascii?q?XuEYoZ+hASCSIlAhGVIiVCHDhQegRQPEIFNEihEFAV+gmhJgglUAYcegU8BAQE?= X-IPAS-Result: =?us-ascii?q?A0AuDwCN2HxYhxMP49RdGQEBAQEBAQEBAQEBBwEBAQEBFAE?= =?us-ascii?q?BAQEBAQEBAQEBBwEBAQEBgw4BAQEBAX6BCQeDSooHhzQZikiCNpJ2ggsqhXgCg?= =?us-ascii?q?hMHPxgBAQEBAQEBAQEBARIBAQEIDQkKHTCCMwQBFgWCFgEBAQMBI0sLBQsLCw0?= =?us-ascii?q?NHQICHgMBDQUBBQEKEgYTEohVAQECEAgECqIJP4wDgiWEaIF1ASYBIwMKgkwBA?= =?us-ascii?q?QEBAQEEAQEBAQEBIoZFhGeCUIREOoJeBYckDIhxhQ6FUw0rgXuEYoZ+hASCSIl?= =?us-ascii?q?AhGVIiVCHDhQegRQPEIFNEihEFAV+gmhJgglUAYcegU8BAQE?= X-IronPort-AV: E=Sophos;i="5.33,239,1477954800"; d="scan'208,217";a="255538268" Received: from mout.gmx.net ([212.227.15.19]) by mail2-smtp-roc.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 16 Jan 2017 15:30:58 +0100 Received: from mail-yw0-f171.google.com ([209.85.161.171]) by mail.gmx.com (mrgmx002 [212.227.17.190]) with ESMTPSA (Nemesis) id 0Lw285-1cUJY43XAb-017p1S for ; Mon, 16 Jan 2017 15:30:58 +0100 Received: by mail-yw0-f171.google.com with SMTP id w75so69158813ywg.1 for ; Mon, 16 Jan 2017 06:30:57 -0800 (PST) X-Gm-Message-State: AIkVDXK9bMRETapAEbb7WGdZi04FqGheUZWbnX+M/kul37D5xm718sShcSl4Y70IW1uR9zJ6IZ+T72712uq/Ww== X-Received: by 10.13.220.197 with SMTP id f188mr26590970ywe.6.1484577056798; Mon, 16 Jan 2017 06:30:56 -0800 (PST) MIME-Version: 1.0 Reply-To: helmut.brandl@gmx.net Received: by 10.37.179.7 with HTTP; Mon, 16 Jan 2017 06:30:56 -0800 (PST) Received: by 10.37.179.7 with HTTP; Mon, 16 Jan 2017 06:30:56 -0800 (PST) In-Reply-To: References: <91217907-3b9e-9977-79cc-fc29fe7a290d@gmx.net> From: Helmut Brandl Date: Mon, 16 Jan 2017 08:30:56 -0600 X-Gmail-Original-Message-ID: Message-ID: To: Philippe Veber Cc: Caml List , =?UTF-8?Q?Nicol=C3=A1s_Ojeda_B=C3=A4r?= Content-Type: multipart/alternative; boundary=94eb2c07bc901cc2ab05463708ca X-Provags-ID: V03:K0:iBkwU4om2hmkShTZfVmqCNK7Rohf8ffGXzhsOngLZPONWwlgWYX ul0TWmMlOXdIdoGbPwF0ZX+rx3N/+gJbSClXp00CXqF2ielPDQAU2urzPCItKlDUBs0Kk6W P2aHsLTrHGRwd6d/poh7CLz744JN3KYUm1iVZsRpvUjoy28hkQuDMU49BLyLqTYvLMUuYZN ps0hsc3PAZfNInW6hT+Gg== X-UI-Out-Filterresults: notjunk:1;V01:K0:xuRacUfI9M0=:gfr2PjYfawR9tSOyaLtcQg nA7IA72Bei5TIXpWTJeiPN4ZXbbbTyww04Ro48crBeROTg+y0XU1k6nQraP3kQ7EbBmrLRlL1 RsvU8qK8bX0/rlWTfwLgbjmSdJBKfvmZbazhzhhu6TIMUoEGSt+WGQjCoAik593xnDbMZSsLa Bmz/SJvecSYEL73aJysSjms5lqLChGhNFN54evRZr4Z9eEpQ7X+MlRP77pOa2XTRRMpi1PtN5 ylPH7BJfMJ3qq6AlkL9BU7lODLTJ6zK5hsC94VkXZPOJ1oHEofiN/lA2kTfZLkSAIjMeWCuRm 6KSW+Ppt0T/e2rOYZi/GzZfSxEP5jAmBYGkNRHTiFoM96ZfUv7o/YJOLzh/e0NFhnLg+qRvRc 9H66rHALNelGYlaRKh9xEzscTwz5EQoVnEBnDExNcyIPaBkTPg5FA63/eumpnu5RZR4xJNxap mfh7UTSd59VjMlOyH8ZeRHCN+Cbl/2GOdZHQyJ0W75JkUvLChYPU1kQo/QxtQlFY/2Vf/X/qi /TQt11D53PK4T3Ukrige6cMtzDrdCXOHl9WKhA5Q7vkurwcx5S4tm/+1x3xLRpN4499h4Rfoz Egm1DhTdwOT/bEHnxWLbl5TKtHBBJ3dNsePdczifg/GuZ9fcEnGpAWhqDmp7rpHL999UpWEq9 79U83Z+kB0Z9p4/b4+Cn1djOj3q3Y3OaPW0bIXniwMPfGQTg84QGVIBduH0x3PjZkyQyhosrI 2xNot5FKGpNXK+ePHX6vRlKy8SiZzUmZEMWxG2xPy4DVF+c/4q5gB0l+DASOpWC5B1ecPN9Vw gjxv+t5 Subject: Re: [Caml-list] Beginners Question for js_of_ocaml --94eb2c07bc901cc2ab05463708ca Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Sounds interesting. On Jan 14, 2017 12:16 PM, "Philippe Veber" wrote: > Also note there are bindings to nodejs for js_of_ocaml [1] developped by > Edgar Aroutiounian. I have not checked if the functions you need are in > there, but if they're not, you could contribute them to this project. > > Hope that helps, > philippe. > > [1] https://github.com/fxfactorial/ocaml-nodejs > > 2017-01-14 8:49 GMT+01:00 Nicol=C3=A1s Ojeda B=C3=A4r > : > >> Hi Helmut, >> >> I am a js_of_ocaml beginner, but it sounds like you could do it using : >> >> Js.Unsafe.fun_call (Js.Unsafe.js_expr "readdirSync") [| .. args , >> wrapped with Js.Unsafe.inject .. |] >> >> You can look at the docs at https://ocsigen.org/js_of_ocam >> l/2.8.3/manual/bindings, especially under >> "Binding a JS function", where there is an example with the function >> "decodeURI". >> >> Cheers! >> >> Best wishes, >> Nicolas >> >> >> >> >> >> On Sat, Jan 14, 2017 at 12:58 AM, Helmut Brandl >> wrote: >> >>> Hello List, >>> >>> I am trying to use js_of_ocaml to compile my ocaml project for the >>> nodejs ecosystem. Since js_of_ocaml does not compile calls to the 'unix' >>> library I have to call some javascript functions directly from ocaml. A= ll I >>> need is to be able to call the javascript functions >>> >>> - readdirSync >>> - mkdirSync >>> - rmdirSync >>> - statSync >>> >>> and receive the results in ocaml. >>> >>> I have looked into the documentation and into the examples, but I have >>> not found a way on how to do this. All examples are for use in the brow= ser. >>> Maybe its a stupid question and it is so simple that I, as a beginner in >>> js_of_ocaml, just don't see it. >>> >>> Can anybody give me a hint? Thanks in advance. >>> >>> Regards >>> Helmut >>> >>> >>> -- >>> 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 >>> >> >> > --94eb2c07bc901cc2ab05463708ca Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Sounds interesting.

<= div class=3D"gmail_quote">On Jan 14, 2017 12:16 PM, "Philippe Veber&qu= ot; <philippe.veber@gmail.co= m> wrote:
Also note there are bindings to nodejs for js_of_oc= aml [1] developped by Edgar Aroutiounian. I have not checked if the functio= ns you need are in there, but if they're not, you could contribute them= to this project.

Hope that helps,
=C2=A0 philippe.
[1] https://github.com/fxfactorial/ocaml-nodejs
=

2017-01-14 8:49 G= MT+01:00 Nicol=C3=A1s Ojeda B=C3=A4r <nicolas.ojeda.bar@lexifi.= com>:
Hi Helmut,

I am a js_of_ocaml beginn= er, but it sounds like you could do it using :

=C2= =A0 Js.Unsafe.fun_call (Js.Unsafe.js_expr "readdirSync") [| .. ar= gs , wrapped with Js.Unsafe.inject .. |]

You can l= ook at the docs at https://ocsigen.org/js_of_ocaml/2.8.3/manu= al/bindings, especially under
"Binding a JS function&quo= t;, where there is an example with the function "decodeURI".

Cheers!

Best wishes,
Nicolas




=

On Sat, Jan 14, 2017 at 12:58 AM, Helmut Brandl &= lt;helmut.brandl= @gmx.net> wrote:
Hello List,

I am trying to use js_of_ocaml to compile my ocaml project for the nodejs e= cosystem. Since js_of_ocaml does not compile calls to the 'unix' li= brary I have to call some javascript functions directly from ocaml. All I n= eed is to be able to call the javascript functions

- readdirSync
- mkdirSync
- rmdirSync
- statSync

and receive the results in ocaml.

I have looked into the documentation and into the examples, but I have not = found a way on how to do this. All examples are for use in the browser. May= be its a stupid question and it is so simple that I, as a beginner in js_of= _ocaml, just don't see it.

Can anybody give me a hint? Thanks in advance.

Regards
Helmut


--
Caml-list mailing list.=C2=A0 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


--94eb2c07bc901cc2ab05463708ca--