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 4765E7F02A for ; Mon, 10 Oct 2016 10:47:33 +0200 (CEST) Authentication-Results: mail3-smtp-sop.national.inria.fr; spf=None smtp.pra=gustave.nimant@free.fr; spf=None smtp.mailfrom=gustave.nimant@free.fr; spf=None smtp.helo=postmaster@smtp6-g21.free.fr Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of gustave.nimant@free.fr) identity=pra; client-ip=212.27.42.6; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="gustave.nimant@free.fr"; x-sender="gustave.nimant@free.fr"; x-conformance=sidf_compatible Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of gustave.nimant@free.fr) identity=mailfrom; client-ip=212.27.42.6; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="gustave.nimant@free.fr"; x-sender="gustave.nimant@free.fr"; x-conformance=sidf_compatible Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of postmaster@smtp6-g21.free.fr) identity=helo; client-ip=212.27.42.6; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="gustave.nimant@free.fr"; x-sender="postmaster@smtp6-g21.free.fr"; x-conformance=sidf_compatible IronPort-PHdr: =?us-ascii?q?9a23=3Ax6TWYREySu+yNM2L+fQFBZ1GYnF86YWxBRYc798d?= =?us-ascii?q?s5kLTJ75r8ywAkXT6L1XgUPTWs2DsrQf2rCQ6PCrATdIyK3CmUhKSIZLWR4BhJ?= =?us-ascii?q?detC0bK+nBN3fGKuX3ZTcxBsVIWQwt1Xi6NU9IBJS2PAWK8TWM5DIfUi/yKRBy?= =?us-ascii?q?brysXNWD1YLsh6vqoNX6WEZhvHKFe7R8LRG7/036l/I9ps9cEJs30QbDuXBSeu?= =?us-ascii?q?5blitCLFOXmAvgtI/rpMYwuwwZgf8q9tZBXKPmZOx4COUAVHV1e1wysYfgvBzH?= =?us-ascii?q?CA+O/Wc0U2MMkxMODRKPpEXxV5L19y/7rfZV2S+APMSwQ6piChq46KI+ZwLzlC?= =?us-ascii?q?4ZOnYf8WTejNA42K1Guw6ouRE5xY/RaYeJHPRkc66bc8lMFjkJZdpYSyEUWtD0?= =?us-ascii?q?VIAIFedUeL8A94Q=3D?= X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: =?us-ascii?q?A0DBAQBbVftXhgYqG9RbGgEBAQECAQEBA?= =?us-ascii?q?QgBAQEBFQEBAQECAQEBAQgBAQEBgxEBAQEBAXR8AaQ1j3GGSyiEaIEQAoIAPBA?= =?us-ascii?q?BAQEBAQEBAQEBARIBAQEICwsJGSQLgjIEARUBBIIRAQEEI1UBEAsEFAkWCwICC?= =?us-ascii?q?QMCAQIBRQYNCAKIMQEeCrRIiC4JhDIBAQEBAQUBAQEBASOGPYRVh0uCPh0Fjjq?= =?us-ascii?q?LRV6BB4RCiVaBbk6EGYMUhgtJjC6DfzVegwiBYHABhg2BQQEBAQ?= X-IPAS-Result: =?us-ascii?q?A0DBAQBbVftXhgYqG9RbGgEBAQECAQEBAQgBAQEBFQEBAQE?= =?us-ascii?q?CAQEBAQgBAQEBgxEBAQEBAXR8AaQ1j3GGSyiEaIEQAoIAPBABAQEBAQEBAQEBA?= =?us-ascii?q?RIBAQEICwsJGSQLgjIEARUBBIIRAQEEI1UBEAsEFAkWCwICCQMCAQIBRQYNCAK?= =?us-ascii?q?IMQEeCrRIiC4JhDIBAQEBAQUBAQEBASOGPYRVh0uCPh0FjjqLRV6BB4RCiVaBb?= =?us-ascii?q?k6EGYMUhgtJjC6DfzVegwiBYHABhg2BQQEBAQ?= X-IronPort-AV: E=Sophos;i="5.31,471,1473112800"; d="scan'208,217";a="196208769" Received: from smtp6-g21.free.fr ([212.27.42.6]) by mail3-smtp-sop.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 10 Oct 2016 10:47:22 +0200 Received: from [192.168.0.12] (unknown [88.191.137.54]) by smtp6-g21.free.fr (Postfix) with ESMTP id 60FBF7802C2; Mon, 10 Oct 2016 10:47:22 +0200 (CEST) References: <57F50A2E.5020900@free.fr> Cc: Pierrick Couderc To: "caml-list@inria.fr" From: Gustave Nimant Message-ID: <57FB559A.1070302@free.fr> Date: Mon, 10 Oct 2016 10:47:22 +0200 User-Agent: Mozilla/5.0 (X11; Linux i686; rv:38.0) Gecko/20100101 Icedove/38.5.0 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/alternative; boundary="------------070808000006050308040105" Subject: Re: [Caml-list] How to get the path of Filename.current_dir_name This is a multi-part message in MIME format. --------------070808000006050308040105 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit On 05/10/2016 16:34, Pierrick Couderc wrote: > > If I understood correctly, it is more about the directory of the > module at compile time. > the absolute path of the module at compile time. > One (hackish) way to do it is with the value __FILE__ in Pervasives > (see > http://caml.inria.fr/pub/docs/manual-ocaml/libref/Pervasives.html#6_Debugging > for some compile time constant used for debugging). > It simply returns the path of the .ml given to the compiler, not an > absolute path (except if you called the compiler on an absolute path, > of course). > __FILE__ returns the name of the module, not the name and absolute path. I do not understand what do you mean by "except if you called the compiler on an absolute path, of course" could you please give me more details about calling the compiler on an absolute path ? Thanks Gustave --------------070808000006050308040105 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: 8bit
On 05/10/2016 16:34, Pierrick Couderc wrote:

If I understood correctly, it is more about the directory of the module at compile time. 

the absolute path of the module at compile time.
One (hackish) way to do it is with the value __FILE__  in Pervasives (see http://caml.inria.fr/pub/docs/manual-ocaml/libref/Pervasives.html#6_Debugging for some compile time constant used for debugging). 
It simply returns the path of the .ml given to the compiler, not an absolute path (except if you called the compiler on an absolute path, of course). 

 __FILE__ returns the name of the module, not the name and absolute path.
I do not understand what do you mean by "except if you called the compiler on an absolute path, of course"
could you please give me more details about calling the compiler on an absolute path ?

Thanks
Gustave
--------------070808000006050308040105--