Boost logo

Boost :

From: David Abrahams (dave_at_[hidden])
Date: 2003-11-03 16:12:31


Beman Dawes <bdawes_at_[hidden]> writes:

> At 11:14 PM 10/31/2003, Walter Landry wrote:
>
> >I still haven't heard anything, but I found another problem with
> >symlinks. Consider the directory structure
> >
> > foo
> > foo/bar
> > foo/bar/baz
> > foo/bar/baz/bat
> > foo/frob --> bar/baz/
> >
> >where the last directory is a symlink. If I am sitting in foo and type
> >
> > $ ls frob/../baz
> >
> >I get
> >
> > bat/
> >
> >However, the filesystem library wants to shorten this into just "baz".
> >This, of course, is incorrect. So it seems like you should never
> >attempt to shorten a path by removing any instances of "../". Rather,
> >boost::filesystem can provide methods to get the fully canonical name
> >of a path. I don't know about Windows, but this seems to map more
> >closely with Unix semantics. Agree? Disagree?
> >
> >Looking for feedback.
>
> The current design of class path is based on purely syntactic
> considerations. There is no consideration of any meaning or attributes
> attached to any name. Conversion to canonical form is based on syntax
> only.
>
> It would be possible to maintain the path exactly as entered, rather
> than converting to canonical form.

For what it's worth (not much probably), my intuition tells me that
preserving the native form of a path is the right way to do it.

-- 
Dave Abrahams
Boost Consulting
www.boost-consulting.com

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk