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 sympa.inria.fr (Postfix) with ESMTPS id 6C6877FA5F for ; Mon, 16 Jan 2017 15:25:41 +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.17.20; 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.17.20 as permitted sender) identity=mailfrom; client-ip=212.227.17.20; 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.17.20; 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=3AZ/YDRx+/xYu6m/9uRHKM819IXTAuvvDOBiVQ1KB9?= =?us-ascii?q?1OwcTK2v8tzYMVDF4r011RmSDNmdsK8P0rqL++C4ACpbvsbH6ChDOLV3FDY7yu?= =?us-ascii?q?wu1zQ6B8CEDUCpZNXLVAcdWPp4aVl+4nugOlJUEsutL3fbo3m18CJAUk6nbVk9?= =?us-ascii?q?Dq3PF4XTl8W60fyps92WOl0QxWmLWq5pNBi9sSnWs8AXh8MidvdwmVP1pS5ueu?= =?us-ascii?q?9RwepzEnWRkhr10e085tY39SVbvPYo7IhHU6j2duIyRKZwCDk2Mm40osbssE+Q?= =?us-ascii?q?dwaX4mogVTAWnx5NHhSD5gvzWJv1miT/pqx71TXJE9fxSOUUVDCn8rsjYgXhji?= =?us-ascii?q?sDf2o5/WXSl9A2hrhSph6ljxN608jSbZ3DZ6k2Rb/UYd5PHTkJZc1WTSEUR97l?= =?us-ascii?q?Yg=3D=3D?= X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: =?us-ascii?q?A0C4EwBg13xYhhQR49RdGgEBAQECAQEBA?= =?us-ascii?q?QgBAQEBFQEBAQECAQEBAQgBAQEBgw4BAQEBAX6BCQeDSooHhzQZikiCNpJ2ggs?= =?us-ascii?q?qhXgCghUHPxgBAQEBAQEBAQEBARIBAQEICwsKHTCCMwQBFgWCFwEEASNLCwULC?= =?us-ascii?q?wsaHQICHgQNBQEFAQoSBhMSiFUBAQIQCAQKogk/jAOCJYRogXUBJgEjA4JWAQE?= =?us-ascii?q?BAQEFAQEBAQEBIoZFhGeCUIREDC6CXgWHJAyIcYUOhWArgXuEYosCgkiJQIRlS?= =?us-ascii?q?JBeFB6BFA8QgU0SKEQUBX6CaDgRC4F+VAGHHoFPAQEB?= X-IPAS-Result: =?us-ascii?q?A0C4EwBg13xYhhQR49RdGgEBAQECAQEBAQgBAQEBFQEBAQE?= =?us-ascii?q?CAQEBAQgBAQEBgw4BAQEBAX6BCQeDSooHhzQZikiCNpJ2ggsqhXgCghUHPxgBA?= =?us-ascii?q?QEBAQEBAQEBARIBAQEICwsKHTCCMwQBFgWCFwEEASNLCwULCwsaHQICHgQNBQE?= =?us-ascii?q?FAQoSBhMSiFUBAQIQCAQKogk/jAOCJYRogXUBJgEjA4JWAQEBAQEFAQEBAQEBI?= =?us-ascii?q?oZFhGeCUIREDC6CXgWHJAyIcYUOhWArgXuEYosCgkiJQIRlSJBeFB6BFA8QgU0?= =?us-ascii?q?SKEQUBX6CaDgRC4F+VAGHHoFPAQEB?= X-IronPort-AV: E=Sophos;i="5.33,239,1477954800"; d="scan'208,217";a="255535581" Received: from mout.gmx.net ([212.227.17.20]) by mail2-smtp-roc.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 16 Jan 2017 15:24:11 +0100 Received: from mail-yw0-f179.google.com ([209.85.161.179]) by mail.gmx.com (mrgmx103 [212.227.17.168]) with ESMTPSA (Nemesis) id 0MfVzj-1c5g4P2hqd-00P5pL for ; Mon, 16 Jan 2017 15:24:10 +0100 Received: by mail-yw0-f179.google.com with SMTP id l75so69048667ywb.0 for ; Mon, 16 Jan 2017 06:24:10 -0800 (PST) X-Gm-Message-State: AIkVDXLKSmK5ieBM7Fg6IiTBs57+ovAnJ6aYOZuR7vELYfY0xdLSxIDtl9Zyo4EdxVTyvyx/4hXdAqjXUaZ8xw== X-Received: by 10.129.59.9 with SMTP id i9mr28972613ywa.79.1484576649597; Mon, 16 Jan 2017 06:24:09 -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:24:08 -0800 (PST) Received: by 10.37.179.7 with HTTP; Mon, 16 Jan 2017 06:24:08 -0800 (PST) In-Reply-To: References: <91217907-3b9e-9977-79cc-fc29fe7a290d@gmx.net> From: Helmut Brandl Date: Mon, 16 Jan 2017 08:24:08 -0600 X-Gmail-Original-Message-ID: Message-ID: To: =?UTF-8?Q?Nicol=C3=A1s_Ojeda_B=C3=A4r?= Cc: Caml List Content-Type: multipart/alternative; boundary=001a114325bcd75cd1054636efee X-Provags-ID: V03:K0:jrcTpqMjai5kby88y4kk8bEuAlfUWHnKNqfvz6yAKHCAA6/iUyN UfxzZQ7icQbel2YEJPs+MCHRvZX9LlgGSZL1kmzuyTfm/RAveJbJei5Ncbw8ZCBHn1jjwW+ jgPpMY1VgkWbRd/UakTrVuzdabJ/n/XJro3ivDrn3T5nHs/ZIrUdmostzqZ6Jc2tDevLq8D suAsijsiL9867/A6l3IEA== X-UI-Out-Filterresults: notjunk:1;V01:K0:3MBx8ZXIdp8=:LraSmG4N0Y9d2z8FLJQbdg RW1qq8amf5nFbbW8/9Y5uRu9nitFYoJ6SAm36XvPFRvnJ99IMIu5ulhWQDQxOEwKT5lcZdHf7 y8xKP+27E2g4OMBnL9qIouSAW0oghavVPSDeokOoRVXL6MZBjzyb8IlhHoe22lMa2topuZyFe hNqB3ObTFLwoICCpBkJfTn0dvoV3LxVVgs6U3OkSivCGAUXr2c987YqIUm8mgWKr2pTv6UCaa 3bUe+AxBpkO+iVASTI8MgeTFrWttCEnrHFoAEil8ciJ8mW4quQ/gPwzYupv/JhAJkv6HRv/aw QHY0xfMAiuL9QBrRllZPQ4S6Hpy4q50szv0el9BCioGUIiR+5H0u9dlBz+WcpPv5r1WZqgbWt M3vSBS8VETiFPVv739/K+cC9BCo3IfJ3F4Sw4dcZ+3TEuhhBhilCgPgTFDuoyD71pzyZ+Gvhf STy0oEj1wPZSj/h0amy1A74jEyBlxAABnpDfbnFrkVo2MnvaboFJZP2NQxNlAxlldwc93mwTB lMOnJuOCWe01IREUlEnm9gRLGDCreQg010z3b+rect5fHOy1UaRtxSI0aMMMms9PZVjLPPcLE vabZwmu92R0T4owkzVdDkJtlZ/t8BciVbPZm7sKkHvZRCY7HMpmi+ri204QW7qMeOeGIJR8+c B2vl+6stWBp79wmzT7cgRaG+lq6hz7mIYUCiICQrVHWTCzRZ46wO2vZE7iUKthrmgO5VnI3Uq czuV0Wmh6BhD8IfJh83ALGSxC5ILy/C1rfnO7VY5iVM+WSUkPJNuSClZO/rp+y0uh053SHeTt /6OAUPo Subject: Re: [Caml-list] Beginners Question for js_of_ocaml --001a114325bcd75cd1054636efee Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Hello Nicolas, thanks for the hint. It works nearly as you explained. I have to get first the fs object and then make a method call and not a function call. As you explained there is all information necessary in the documentation. I just did not find it in my first attempt. Regards Helmut On Jan 14, 2017 1:49 AM, "Nicol=C3=A1s Ojeda B=C3=A4r" wrote: 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_ ocaml/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. All 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 browser. > 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 > --001a114325bcd75cd1054636efee Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Hello Nicolas,

thanks for the hint. It works nearly as you explained. I have= to get first the fs object and then make a method call and not a function = call.

As you explained t= here is all information necessary in the documentation. I just did not find= it in my first attempt.

Regards=C2=A0
Helmut

On Jan 14, 2017 1:49 AM, "= Nicol=C3=A1s Ojeda B=C3=A4r" <nicolas.ojeda.bar@lexifi.com> wrote:
Hi Helmut,

I am a js_of_ocaml beginner, but it sounds like you could do it using :

=C2=A0 Js.Unsafe.fun_call (Js.Unsafe.js_expr "r= eaddirSync") [| .. args , wrapped with Js.Unsafe.inject .. |]

You can look at the docs at https://ocsigen.org/j= s_of_ocaml/2.8.3/manual/bindings, especially under
"= ;Binding a JS function", where there is an example with the function &= quot;decodeURI".

Cheers!

=
Best wishes,
Nicolas





On Sat, Jan 14, 2017 at 12:58 AM,= Helmut Brandl <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


--001a114325bcd75cd1054636efee--