Boost logo

Boost :

From: Scott McMurray ([hidden])
Date: 2008-07-11 21:35:13

On Fri, Jul 11, 2008 at 14:11, Loïc Joly
<loic.actarus.joly_at_[hidden]> wrote:
> I'd like to know if there is in boost::filesystem a way to "resolve" a path.
> For instance, I have a path that is built from :
> "c:\foo1\foo2\..\bar1\bar2"
> And I'd like to obtain:
> "c:\foo1\bar1\bar2"

As I recall, that used to be called canonize, but it seems to have disappeared.

There are still references to it, though, such as "Move canonize() and
normalize() to convenience.hpp?" in the do list, and "Symbolic links
cause canonical and normal form of some paths to represent different
files or directories. For example, given the directory hierarchy
/a/b/c, with a symbolic link in /a named x pointing to b/c, then
under POSIX Pathname Resolution rules a path of "/a/x/.." should
resolve to "/a/b". If "/a/x/.." were first normalized to "/a", it
would resolve incorrectly. (Case supplied by Walter Landry.)" in the
design rationale.

(It'd be nice to have to make uncomplete easy to write, too.)

Boost list run by bdawes at, gregod at, cpdaniel at, john at