From: Vladimir Prus (ghost_at_[hidden])
Date: 2002-09-17 09:55:11
Beman Dawes wrote:
> At 05:57 AM 9/17/2002, Vladimir Prus wrote:
> >1. Say I have a path. I want to treat it as relative to some other
> >directory, if it is relative. That is, I want function
> > path root ( const path& p, const path& r )
> >which will work like
> > root ( "/home/ghost/a" , "/home/ghost" ) = "/home/ghost/a"
> > root ( "a" , "/home/ghost" ) = "/home/ghost/a"
> >How can I do that? I seems rather hard currently -- I see no way to join
> >two paths
> Operator <<= and operator << do that, if I understand your question.
Oh, I entirely missed the fact that operator << works with paths...
However, the following program on Linux says "Aborted".
using namespace std;
namespace fs = boost::filesystem;
fs::path p1("/home/ghost"), p2("/a/b/c");
cout << (p1 << p2).file_path() << "\n";
The problem is at
#7 0x0804c9fd in boost::filesystem::path::path (this=0xbffff878,
186 m_path_append( src );
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk