Boost logo

Boost :

From: Scott McMurray (me22.ca+boost_at_[hidden])
Date: 2008-05-30 14:08:55


On Fri, May 30, 2008 at 11:40 AM, Beman Dawes <bdawes_at_[hidden]> wrote:
> Scott McMurray wrote:
>> On Fri, May 30, 2008 at 8:53 AM, Beman Dawes <bdawes_at_[hidden]> wrote:
>>> Scott McMurray wrote:
>
>>>> And while we're on the subject of decomposition, would it be
>>>> worthwhile to add decomposition from the front in terms of an
>>>> uncomplete() function that'd give a relative path from one full path
>>>> to another? uncomplete(/foo/new, /foo/bar) => ../new
>>>>
>>>> I think that complete is the only function without a corresponding inverse.
>>> Do you have a compelling use case beyond complete not having an inverse?
>>>
>>
>> Any time you get a full path (from, say, an open file dialog) and
>> you'd rather have the relative one to save, so that it won't break
>> when moved around. An IDE, for example, would prefer a path relative
>> to the project file's directory, so that you could check it out of SVN
>> to whatever folder.
>
> That seems compelling. Please submit a feature request to trac.
>

Submitted: http://svn.boost.org/trac/boost/ticket/1976

The obvious implentation complication is that if /foo/bar is a
symlink, then trying to put the path back together with
complete(../new, /foo/bar) will give /foo/bar/../new, which might not
actually be /foo/new.


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