From: Christophe Raffalli <christophe.raffalli@univ-savoie.fr>
To: caml-list@inria.fr
Subject: absolute_name ?
Date: Fri, 20 Jul 2007 18:55:49 +0200 [thread overview]
Message-ID: <46A0E915.1000903@univ-savoie.fr> (raw)
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
---------------------------------------------
next reply other threads:[~2007-07-20 16:55 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-07-20 16:55 Christophe Raffalli [this message]
2007-07-20 21:23 ` Sylvain Le Gall
[not found] ` <46B1BCD1.9030004@trusted-labs.fr>
2007-08-02 14:36 ` [Caml-list] " Christophe Raffalli
2007-08-02 16:21 ` skaller
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=46A0E915.1000903@univ-savoie.fr \
--to=christophe.raffalli@univ-savoie.fr \
--cc=caml-list@inria.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