Boost logo

Boost :

From: Rob Stewart (stewart_at_[hidden])
Date: 2002-09-18 15:10:40

From: "Peter Dimov" <pdimov_at_[hidden]>
> path p( argv[1], system_specific);
> path q = make_absolute(p);

How about this:

path p(argv[1], make_absolute);

The term "absolute" implies system specific, and this approach
avoids the extra step of calling make_absolute().

> Note that make_absolute doesn't treat p as relative to initial_directory,
> but as relative to the current directory. For rationale, consider the

Yes, the "make_absolute" notion must make an absolute pathname
appropriate for the system. That means it must specify a path
starting with "/" for Posix systems, a drive letter for DOS-like
systems, etc.

> As an enhancement, make_absolute can be made to accept a second argument,
> the "logical" current directory.

I think that's worthwhile. Consider the case in which the
"logical current directory" comes from some other programmatic
source such as a configuration file or other user input. Since
Boost.FileSystem doesn't (and quite reasonably shouldn't) offer
the means to change the current directory, you can't effect the
"logical current directory" behavior any other way.

> I see less need for the reverse operation, make_relative.


Rob Stewart                           stewart_at_[hidden]
Software Engineer           
Susquehanna International Group, LLP  using std::disclaimer;

Boost list run by bdawes at, gregod at, cpdaniel at, john at