From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=AWL autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from discorde.inria.fr (discorde.inria.fr [192.93.2.38]) by yquem.inria.fr (Postfix) with ESMTP id 61E93BC69 for ; Fri, 20 Jul 2007 18:55:54 +0200 (CEST) Received: from net.univ-savoie.fr (net.univ-savoie.fr [193.48.120.75]) by discorde.inria.fr (8.13.6/8.13.6) with ESMTP id l6KGtrxP030616 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO) for ; Fri, 20 Jul 2007 18:55:54 +0200 Received: from post.bourget.univ-savoie.fr (post.bourget.univ-savoie.fr [193.48.120.73]) by net.univ-savoie.fr (8.12.3/jtpda-5.4) with ESMTP id l6KGtn2i000690 for ; Fri, 20 Jul 2007 18:55:49 +0200 Received: from [193.48.123.45] (d45.lama.univ-savoie.fr [193.48.123.45]) by post.bourget.univ-savoie.fr (8.12.3/jtpda-5.4) with ESMTP id l6KGthIx020457 ; Fri, 20 Jul 2007 18:55:43 +0200 Message-ID: <46A0E915.1000903@univ-savoie.fr> Date: Fri, 20 Jul 2007 18:55:49 +0200 From: Christophe Raffalli User-Agent: Thunderbird 1.5.0.10 (X11/20070403) MIME-Version: 1.0 To: caml-list@inria.fr Subject: absolute_name ? Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.33 (www . roaringpenguin . com / mimedefang) X-Miltered: at discorde with ID 46A0E919.000 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; christophe:01 raffalli:01 christophe:01 raffalli:01 univ-savoie:01 basename:01 dirname:01 getcwd:01 chdir:01 getcwd:01 chdir:01 lib:01 chablais:01 73376:01 univ-savoie:01 Is this the best (and only) way to get the absolute name to a file in a way that would work on all system (windonws, OS X, unix, ...) ? let absolute_name str = let base = Filename.basename str in let dir = Filename.dirname str in let saved_dir = Sys.getcwd () in Sys.chdir dir; let res = Filename.concat (Sys.getcwd ()) base in Sys.chdir saved_dir; res I find this a bit complicated, so I may be missing some functions in Sys, Filename or some other lib ... -- Christophe Raffalli Université de Savoie Batiment Le Chablais, bureau 21 73376 Le Bourget-du-Lac Cedex tél: (33) 4 79 75 81 03 fax: (33) 4 79 75 87 42 mail: Christophe.Raffalli@univ-savoie.fr www: http://www.lama.univ-savoie.fr/~RAFFALLI --------------------------------------------- IMPORTANT: this mail is signed using PGP/MIME At least Enigmail/Mozilla, mutt or evolution can check this signature. The public key is stored on www.keyserver.net ---------------------------------------------