caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* absolute_name ?
@ 2007-07-20 16:55 Christophe Raffalli
  2007-07-20 21:23 ` Sylvain Le Gall
       [not found] ` <46B1BCD1.9030004@trusted-labs.fr>
  0 siblings, 2 replies; 4+ messages in thread
From: Christophe Raffalli @ 2007-07-20 16:55 UTC (permalink / raw)
  To: caml-list


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


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2007-08-02 16:21 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-07-20 16:55 absolute_name ? Christophe Raffalli
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

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