Boost logo

Boost :

Subject: Re: [boost] [filesystem] relative path from arbitrary file system location?
From: Kenny Riddile (kfriddile_at_[hidden])
Date: 2009-02-06 22:32:37


Scott McMurray wrote:
> On Fri, Feb 6, 2009 at 21:22, Kenny Riddile <kfriddile_at_[hidden]> wrote:
>> Is there any existing functionality for getting a relative path from a full
>> path, where the desired relative path is relative to an arbitrary directory
>> path? If not, I'm assuming I would just have to walk up both full paths
>> until I find their intersection...etc
>>
>
> There isn't yet, though I have a ticket filed requesting one:
> https://svn.boost.org/trac/boost/ticket/1976 Please add your use case
> to that ticket.
>
> The v3 lib under discussion has a read_symlink function which will
> allow a non-naïve implementation. In the mean time, if you're in
> windows you can try the implementation in the ticket.
> _______________________________________________
> Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost

Also, may I suggest the name "as_relative_to" for the member function if
this is added to the library? as_relative_to would be a const member
method that take the desired base path as its only parameter and returns
the desired relative path.


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