Boost logo

Boost :

From: Carlo Wood (carlo_at_[hidden])
Date: 2004-09-01 19:48:56


On Wed, Sep 01, 2004 at 02:20:29PM -0400, Beman Dawes wrote:
> >My idea on this was (and still is) that it is possible to convert
> >a relative path to an absolute path (automatically) by adding an
> >absolute path object reference to the relative path object.
>
> Yes, as long as you know the absolute path reference. Is the absolute path

?? You didn't read my posts. I'd *add* that reference to a relative_path.
Reference as in '&'.

class relative_path {
  native_path& absolute_path;
  ...

> reference known for all operating systems? I'm not sure about that. For
> example, there have been multi-rooted systems that didn't have a concept of
> "current drive". How would that work?

Not relevant thus.

> >This should make sense in every application imho.
>
> It makes sense for calling operating system file system functions. It may
> make no sense at all if the use of the path is for reporting or other path
> manipulations.

Then those functions won't complete the path. I always said "when a system
call needs to be called". You didn't read what I posted before.

> The programs which process the Boost regression test bjam
> output do a lot of that. Another example is reporting the path name from a
> filesystem function which throws an exception.

I never said that path::string would complete the path.

> >As a result, you can simply use absolute path types for all those
> >functions that will pass that parameter to a system call.
>
> Don't for get error reporting. While you certainly could report the
> absolute path rather than the path as given, that would be a step backward
> IMO.

I never said that path::string would complete the path.

> >In the case of fs::exists, you would have only fs::exists(fs::native_path
>
> >const&)
> >and when calling that with a fs::relative_path - it would get expanded
> >to the absolute path even before entering fs::exists (this expanding is
> >necessary anyway - so why not before you do the actual call?). That way
> >there is always only one function needed.
>
> You lost me.

Clearly.

> I could see how what you are describing would work for exists(
> fs::absolute_path const & ). It seems you are making some kind of
> assumption regarding the relationship between native paths and absolute
> paths. That is possible to do for Windows and POSIX, but not for operating
> systems in general.

??? You know what assumption I have made? Apparently not, then how
can you claim that this assumption is not true for any operating system
(it is)?

> >Calling fs::exists("foo") would cause the constructor
> fs::native_path(char const*) to be called, ...
>
> What happens when the app wants "foo" treated as a generic rather than
> native format?

Is there a difference in this case? In the end the path must be
completed, or you cannot check if it exists, period.
I am sorry - but it is clear you have no idea what I am talking about
from which I have to conclude that you didn't read my previous posts.

Never mind then.

-- 
Carlo Wood <carlo_at_[hidden]>

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