From: Nicolas C. <war...@fr...> - 2003-11-14 05:34:20
|
Hi list, I came up very recently with a typical problem. I had a file A and its relative path, I had a file B and its absolute path, I wanted to get the file B path relative to A.... not so easy actually. I wrote this small module Path : Path.make "my/../path/./" build a relative path Path.absolute give the absolute path Path.relative a b give the path of a relative to b Path.up goes up one directory I did some tests under windows , it looks like it works well. If people can test it under *nix... Note : this does not actually do any system checking ( the path may not exists or contains invalid characters ). Only special paths . .. and / ( and windows drive letters ) are recognized as special. Nicolas Cannasse |