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 B0AF07FD90 for ; Sat, 14 Jan 2017 19:17:11 +0100 (CET) Authentication-Results: mail3-smtp-sop.national.inria.fr; spf=None smtp.pra=philippe.veber@gmail.com; spf=Pass smtp.mailfrom=philippe.veber@gmail.com; spf=None smtp.helo=postmaster@mail-vk0-f45.google.com Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of philippe.veber@gmail.com) identity=pra; client-ip=209.85.213.45; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="philippe.veber@gmail.com"; x-sender="philippe.veber@gmail.com"; x-conformance=sidf_compatible Received-SPF: Pass (mail3-smtp-sop.national.inria.fr: domain of philippe.veber@gmail.com designates 209.85.213.45 as permitted sender) identity=mailfrom; client-ip=209.85.213.45; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="philippe.veber@gmail.com"; x-sender="philippe.veber@gmail.com"; x-conformance=sidf_compatible; x-record-type="v=spf1" Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of postmaster@mail-vk0-f45.google.com) identity=helo; client-ip=209.85.213.45; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="philippe.veber@gmail.com"; x-sender="postmaster@mail-vk0-f45.google.com"; x-conformance=sidf_compatible IronPort-PHdr: =?us-ascii?q?9a23=3AxEzoVBUTK7f3ewSPLJsfmrDoQrPV8LGtZVwlr6E/?= =?us-ascii?q?grcLSJyIuqrYbRKDt8tkgFKBZ4jH8fUM07OQ6PG8Hzdbqszd7TgrS99lb1c9k8?= =?us-ascii?q?IYnggtUoauKHbQC7rUVRE8B9lIT1R//nu2YgB/Ecf6YEDO8DXptWZBUhrwOhBo?= =?us-ascii?q?KevrB4Xck9q41/yo+53Ufg5EmCex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VSRfaGq1X6?= =?us-ascii?q?I5/j07Ep6pDZ/fRoCxh7yMxDu0EYdTZmBCE1yMFXbod56YW/oXcyKTIsphkiQe?= =?us-ascii?q?WrS7So8h0wuutA7gxLZ9IOrU4H5QiZW28tl+4OlajiYV9zF4BvO3X3vFG2d1lW?= =?us-ascii?q?QMTiRw26JyrUU7wF6Z+ax1k/1WFJpY4PYfASkgMpuJ9+x7D9HqQg+JQNqDRUzu?= =?us-ascii?q?Fs2mADUwVso8hcEDaUtnM9qnhxHHmSGtBulGxPSwGJUo//eEjDDKLMFnxiODif?= =?us-ascii?q?As?= X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: =?us-ascii?q?A0C6BQACanpYhi3VVdFeGQEBAQEBAQEBA?= =?us-ascii?q?QEBBwEBAQEBFQEBAQECAQEBAQgBAQEBgw4BAQEBAX6BCQeDSooHhzOKYYI2hj6?= =?us-ascii?q?HDYUrggsqhXgCghEHPxgBAQEBAQEBAQEBARIBAQEICwsKHTCCMxuCGwEBAQMBI?= =?us-ascii?q?x0BGxILAQMBCwYFCw0NHQICIgERAQUBChIGExKIVQEDEAgOo3g/jAOCAwUBHIM?= =?us-ascii?q?JBYNVChknAwpVgXcBAQEBAQEEAQEBAQEBARkCBhKGM4RnglCCJYJZgl4FhyQMj?= =?us-ascii?q?X+GC4F7hGKLAoJIjiVIkF4UHoEUDxCBTRIdTxSDaykggWs9NQGJGQEBAQ?= X-IPAS-Result: =?us-ascii?q?A0C6BQACanpYhi3VVdFeGQEBAQEBAQEBAQEBBwEBAQEBFQE?= =?us-ascii?q?BAQECAQEBAQgBAQEBgw4BAQEBAX6BCQeDSooHhzOKYYI2hj6HDYUrggsqhXgCg?= =?us-ascii?q?hEHPxgBAQEBAQEBAQEBARIBAQEICwsKHTCCMxuCGwEBAQMBIx0BGxILAQMBCwY?= =?us-ascii?q?FCw0NHQICIgERAQUBChIGExKIVQEDEAgOo3g/jAOCAwUBHIMJBYNVChknAwpVg?= =?us-ascii?q?XcBAQEBAQEEAQEBAQEBARkCBhKGM4RnglCCJYJZgl4FhyQMjX+GC4F7hGKLAoJ?= =?us-ascii?q?IjiVIkF4UHoEUDxCBTRIdTxSDaykggWs9NQGJGQEBAQ?= X-IronPort-AV: E=Sophos;i="5.33,229,1477954800"; d="scan'208,217";a="209148731" Received: from mail-vk0-f45.google.com ([209.85.213.45]) by mail3-smtp-sop.national.inria.fr with ESMTP/TLS/AES128-GCM-SHA256; 14 Jan 2017 19:17:10 +0100 Received: by mail-vk0-f45.google.com with SMTP id r136so52183409vke.1 for ; Sat, 14 Jan 2017 10:17:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=XGdp1L160V+mwWe0ucVVt9eXMVtXRqrWCwBqVJTT1OE=; b=NTuljepLZHdaaVwb88ZySWkCI8GFVc82+Mp6/RLpqcrfb1ajv7aySlpJYT0gA70P99 MIhA55CGCgfdyV+0sdv0bRvLpQLsZV5t/49iUG5Vwf8wNBcdiB2Ji0eg3215xVFPUNkq /nc5Wyp8VOOjYl2FlI1tApUuwiCHQwki77Wyrz9jk7gOE2gdTXMhH9NmT1TygrKLb6/H FIH6HBrLP0doyRe2kNmpQriDNCyjOBu/ZV9ypWcod91I3NMyOPQlNkxmwRrcRVSMxPc3 PPdjtzXxoc+04UuVa0Xhb2p1bR+q8F5kfXGeMDgXCbLqHx8sDAvdqLmlG8VHl3njuFqB 2ang== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=XGdp1L160V+mwWe0ucVVt9eXMVtXRqrWCwBqVJTT1OE=; b=LJKbVa/8eZeHpQ+APCPEtzIYGralOaY1McH5GdLjvyMsmqF1InVP7FJkO/d8Xsysop HgrELqZNMPnZeGVq9O9B8GEgfp9sthYziS/iUjUnW/P1bPhGjR05wR478Kw6H+KQANoa m5HWQFF/Q4TwgUtSXlzTzS9Tt0CQmOFr0WWOvSGkihLi96pUYHk9/D/UqaPaUP3+kToi GOTBVrl4EODRK2P73gYd8pANgoi3CfuQ6q0igb4RZsbWuR+HNg4o2+HqOR/ZzZXNiRJb 4uBT/G0+veqrt/apPSTXmVKCKiMvpC305VBlXkcsmgOXCGiZsh2BiuScc3uXH+hSENuI J2GQ== X-Gm-Message-State: AIkVDXLDYnqPucBukKpDJ0naoaNoQFxK4mV/O5YQ1HSuNgzSgEAAoAQPfS5ut+Q5jmIJdHHHdQcO5jwhN1R0Ww== X-Received: by 10.31.195.130 with SMTP id t124mr12511356vkf.97.1484417829085; Sat, 14 Jan 2017 10:17:09 -0800 (PST) MIME-Version: 1.0 Received: by 10.31.32.193 with HTTP; Sat, 14 Jan 2017 10:16:48 -0800 (PST) In-Reply-To: References: <91217907-3b9e-9977-79cc-fc29fe7a290d@gmx.net> From: Philippe Veber Date: Sat, 14 Jan 2017 19:16:48 +0100 Message-ID: To: =?UTF-8?Q?Nicol=C3=A1s_Ojeda_B=C3=A4r?= Cc: Helmut Brandl , Caml List Content-Type: multipart/alternative; boundary=94eb2c1c03b666a68b054611f5f8 X-Validation-by: philippe.veber@gmail.com Subject: Re: [Caml-list] Beginners Question for js_of_ocaml --94eb2c1c03b666a68b054611f5f8 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable 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_ > 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' librar= y 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 brows= er. >> 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 >> > > --94eb2c1c03b666a68b054611f5f8 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Also note there are bindings to nodejs for js_of= _ocaml [1] developped by Edgar Aroutiounian. I have not checked if the func= tions you need are in there, but if they're not, you could contribute t= hem to this project.

Hope that helps,
=C2=A0 philippe= .

[1] https:= //github.com/fxfactorial/ocaml-nodejs

2017-01-14 8:49 GMT+01:00 Nicol=C3=A1= s Ojeda B=C3=A4r <nicolas.ojeda.bar@lexifi.com>:<= br>
Hi He= lmut,

I am a js_of_ocaml beginner, but it sounds like yo= u could do it using :

=C2=A0 Js.Unsafe.fun_call (J= s.Unsafe.js_expr "readdirSync") [| .. args , wrapped with Js.Unsa= fe.inject .. |]

You can look at the docs at https://ocsigen.org/js_of_ocaml/2.8.3/manual/bindings, especial= ly under
"Binding a JS function", where there is an exa= mple with the function "decodeURI".

Chee= rs!

Best wishes,
Nicolas

<= /div>




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


--94eb2c1c03b666a68b054611f5f8--