caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Gabriel Scherer <gabriel.scherer@gmail.com>
To: Gustave Nimant <gustave.nimant@free.fr>
Cc: "caml-list@inria.fr" <caml-list@inria.fr>
Subject: Re: [Caml-list] How to get the path of Filename.current_dir_name
Date: Wed, 5 Oct 2016 10:22:33 -0400	[thread overview]
Message-ID: <CAPFanBEz4BQGA1hzisMNLSF3bYF=P_uU2mOp=_U=+RMicyDYqg@mail.gmail.com> (raw)
In-Reply-To: <57F50A2E.5020900@free.fr>

[-- Attachment #1: Type: text/plain, Size: 1205 bytes --]

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 <gustave.nimant@free.fr>
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
>

[-- Attachment #2: Type: text/html, Size: 1969 bytes --]

  reply	other threads:[~2016-10-05 14:23 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-27 15:04 [Caml-list] [ANN] BAP 1.0.0 Ivan Gotovchits
2016-10-04 13:30 ` Anil Madhavapeddy
2016-10-05 14:11 ` [Caml-list] How to get the path of Filename.current_dir_name Gustave Nimant
2016-10-05 14:22   ` Gabriel Scherer [this message]
2016-10-05 14:34     ` Pierrick Couderc
2016-10-10  8:47       ` Gustave Nimant
2016-10-10  9:01         ` Pierrick Couderc
2016-10-10 10:26           ` Gustave Nimant
2016-10-05 14:35   ` Daniel Bünzli

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAPFanBEz4BQGA1hzisMNLSF3bYF=P_uU2mOp=_U=+RMicyDYqg@mail.gmail.com' \
    --to=gabriel.scherer@gmail.com \
    --cc=caml-list@inria.fr \
    --cc=gustave.nimant@free.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).