|
Boost : |
From: Beman Dawes (bdawes_at_[hidden])
Date: 2003-11-03 11:52:47
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. There could be a member function that
returned canonical form or maybe forced canonical form. Then your example
would work as you expect it to.
I don't currently have a clue as to the implications of doing that. I'll
try to work that out soon enough to make any changes before 1.31.0 ships.
Thanks for providing the use cases. That is a big help.
--Beman
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk