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 67D327FFE1 for ; Wed, 5 Oct 2016 16:23:19 +0200 (CEST) Authentication-Results: mail3-smtp-sop.national.inria.fr; spf=None smtp.pra=gabriel.scherer@gmail.com; spf=Pass smtp.mailfrom=gabriel.scherer@gmail.com; spf=None smtp.helo=postmaster@mail-it0-f45.google.com Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of gabriel.scherer@gmail.com) identity=pra; client-ip=209.85.214.45; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="gabriel.scherer@gmail.com"; x-sender="gabriel.scherer@gmail.com"; x-conformance=sidf_compatible Received-SPF: Pass (mail3-smtp-sop.national.inria.fr: domain of gabriel.scherer@gmail.com designates 209.85.214.45 as permitted sender) identity=mailfrom; client-ip=209.85.214.45; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="gabriel.scherer@gmail.com"; x-sender="gabriel.scherer@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-it0-f45.google.com) identity=helo; client-ip=209.85.214.45; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="gabriel.scherer@gmail.com"; x-sender="postmaster@mail-it0-f45.google.com"; x-conformance=sidf_compatible IronPort-PHdr: =?us-ascii?q?9a23=3A73UXXxzWXYU2sgrXCy+O+j09IxM/srCxBDY+r6Qd?= =?us-ascii?q?0OoXIJqq85mqBkHD//Il1AaPBtSBrakcwLWL+4nbGkU4qa6bt34DdJEeHzQksu?= =?us-ascii?q?4x2zIaPcieFEfgJ+TrZSFpVO5LVVti4m3peRMNQJW2WVTerzWI4CIIHV2nbEwu?= =?us-ascii?q?d76zQdaZ0Jn//tvx0qWbWx9Piju5bOE6BzSNhiKViPMrh5B/IL060BrDrygAUe?= =?us-ascii?q?1XwWR1OQDbxE6ktY+YtaRu+CVIuv8n69UIEeCjJ/x5HopjES8+PmspyMruvBjF?= =?us-ascii?q?BUvTtzpPGlkRxzVVGBTM8hyyeJb0uy3m/r5yxTKGNNP7C7Y1XD2k849lUhLlzi?= =?us-ascii?q?kdYW0X6mbS3+N5hrharRbpnBd/zpTZesnBO/N0ZKLQeZUBTmpMRMtLfyNEC4K4?= =?us-ascii?q?KYAICrxSbq5js4Dhqg5W/lOFDg62Cbaql2ZF?= X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: =?us-ascii?q?A0BbBwDsC/VXhi3WVdFcHAEBBAEBCgEBG?= =?us-ascii?q?AEFAQsBgxIBAQEBATw5fAekKYIqhhmGVVSGRyaCdIF2gRACgWkHPBABAQEBAQE?= =?us-ascii?q?BAQEBARIBAQEICwsJGS9BEoFfBAEVBYIRAQEDARIRBBkBGxILAQMBCwYFBAcaH?= =?us-ascii?q?QICIgERAQUBChIGExIQiBEBAwYJCA6ePIEyPjKLQoFrgl8Fg2sKGScDCQFTgwk?= =?us-ascii?q?BAQEBAQEEAQEBAQEBARgDBhCGLIRVhHSCV4I9HQWGbAyTAoFlhEKJUII8jTdIj?= =?us-ascii?q?CuCPBMegREPJl6CPCwggXkiNINvgwaBQQEBAQ?= X-IPAS-Result: =?us-ascii?q?A0BbBwDsC/VXhi3WVdFcHAEBBAEBCgEBGAEFAQsBgxIBAQE?= =?us-ascii?q?BATw5fAekKYIqhhmGVVSGRyaCdIF2gRACgWkHPBABAQEBAQEBAQEBARIBAQEIC?= =?us-ascii?q?wsJGS9BEoFfBAEVBYIRAQEDARIRBBkBGxILAQMBCwYFBAcaHQICIgERAQUBChI?= =?us-ascii?q?GExIQiBEBAwYJCA6ePIEyPjKLQoFrgl8Fg2sKGScDCQFTgwkBAQEBAQEEAQEBA?= =?us-ascii?q?QEBARgDBhCGLIRVhHSCV4I9HQWGbAyTAoFlhEKJUII8jTdIjCuCPBMegREPJl6?= =?us-ascii?q?CPCwggXkiNINvgwaBQQEBAQ?= X-IronPort-AV: E=Sophos;i="5.31,449,1473112800"; d="scan'208,217";a="195723265" Received: from mail-it0-f45.google.com ([209.85.214.45]) by mail3-smtp-sop.national.inria.fr with ESMTP/TLS/AES128-GCM-SHA256; 05 Oct 2016 16:23:18 +0200 Received: by mail-it0-f45.google.com with SMTP id o19so176229671ito.1 for ; Wed, 05 Oct 2016 07:23:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=i2zn+Kg3ifQ2Ufs0Imzc5EErLHQNqHODMfrExm9XTzo=; b=NJBtAY0vJhjSbu2Rsbicy/zyofy92q3INRfcpSxMycXU8hm679Wm1oTUY1fZzFSnP2 Fa4pB8cG49MSrgEjyULztZu8/BgT3Rq8HmlA293hN/OPUVbs2wupXiSSxaxUFdzVWUQg XzQXR+BTMNAAaigyHipfNLUOChvSj8EkITAwIFmAT4webB9OYRR9vEZbenZVSWxRNQfe GuxPwHJvUrlfD3xaPjB41h+Una623I9BJUtXL5TacQ2At64TH482YFE1eMvDU6Cf6XpA MMKjq2Ns/CvSH1TIuOVjL4zNiagM4/knKmw8T9AxL8cWh/fQ/6J/taqHN8jxUB9cu5bU Eamw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=i2zn+Kg3ifQ2Ufs0Imzc5EErLHQNqHODMfrExm9XTzo=; b=Y0+hTbR+uLV0OyWgMR1wJaSBSwoMBmGfj1CBiSiz3Ho+9JHJutdsscaJvWcAPxuanx yuIgJIfK+vCX7QZaGXaPN1FpFnlevYUNE51WhtACqdTZzISv4oZKiG2ZtUX4ckkiLznG WXyUy51QMR38mHUXDo9WcDqcVSPkvbLugIi1tAVtMjbkBK8o2Gmebc7sCamsIrXEs9Xe k4X208sxnxUFEebTyzo5Aqx4yduKQdRv4e7vkmD55lPqzVQ+CurAtFJ+Hrw/1cnWo3fS adUvZfexLsvdR5vEmvMmrBBBjCLe0VHrU+6wWZHiGC5XHquhCBtDoL79sj/RVuNgF1Dn Jd7w== X-Gm-Message-State: AA6/9RniWjzJK5lWTUuXFrAB+GgyPGRed+N8TEbKNPjZ6Sfvq6ZaEAMhTd6cn1YCOk/sZRXYp3jfI8RBwj4VDA== X-Received: by 10.107.46.199 with SMTP id u68mr9955415iou.2.1475677393693; Wed, 05 Oct 2016 07:23:13 -0700 (PDT) MIME-Version: 1.0 Received: by 10.79.129.219 with HTTP; Wed, 5 Oct 2016 07:22:33 -0700 (PDT) In-Reply-To: <57F50A2E.5020900@free.fr> References: <57F50A2E.5020900@free.fr> From: Gabriel Scherer Date: Wed, 5 Oct 2016 10:22:33 -0400 Message-ID: To: Gustave Nimant Cc: "caml-list@inria.fr" Content-Type: multipart/alternative; boundary=001a11c14e98dab13d053e1eeada Subject: Re: [Caml-list] How to get the path of Filename.current_dir_name --001a11c14e98dab13d053e1eeada Content-Type: text/plain; charset=UTF-8 Filename.current_dir_name is likely to be just ".", it indicates the (location-agnosti) way to refer to the current directory on your system, to make it easier to write code that is portable on other operating systems with different path conventions. You are probably looking for Sys.getcwd : unit -> string which when called returns the current working directory (as the `pwd` command would do). It may of course change over the time of your program execution, for example if you called Sys.chdir. There is also Sys.executable_name : string (or Sys.argv.(0)) which contains the path of the executable, but it may be a relative path -- it depends on how the program was invoked. On Wed, Oct 5, 2016 at 10:11 AM, Gustave Nimant wrote: > Dear list, > > I would like to get the path of the current directory where the current > executed module is implemented. > Is there any builtin constant ? > I could not find. > > Thanks, > Gustave > > -- > 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 > --001a11c14e98dab13d053e1eeada Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Filename.current_dir_name is likely to be just &= quot;.", it indicates the (location-agnosti) way to refer to the curre= nt directory on your system, to make it easier to write code that is portab= le on other operating systems with different path conventions.

You are probably looking for

=C2=A0 =C2=A0 Sys.getcwd : unit -> = string

which when called returns the current working directory (as t= he `pwd` command would do). It may of course change over the time of your p= rogram execution, for example if you called Sys.chdir. There is also
=C2=A0 Sys.executable_name : string

(or Sys.argv.(0)) wh= ich contains the path of the executable, but it may be a relative path -- i= t depends on how the program was invoked.

On Wed, Oct 5, 2016 at 10:11 AM, Gu= stave Nimant <gustave.nimant@free.fr> wrote:
Dear list,

I would like to get the path of the current directory where the current exe= cuted module is implemented.
Is there any builtin constant ?
I could not find.

Thanks,
Gustave

--
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

--001a11c14e98dab13d053e1eeada--