Boost logo

Boost :

From: Beman Dawes (bdawes_at_[hidden])
Date: 2002-11-08 21:04:47


Geoff,

>I've got an oldish bit of code that manages file paths on windows, unix
>and mac. It's not nearly as full-featured as the filesystem path stuff,
>so obviously I'd like to replace it with the filesystem library.

Please be aware that the Filesystem Library code hasn't be modified yet to
reflect the formal review comments.

I'm planning to start that process in a week. You'll see changes committed
to CVS as they become stable. You might want to wait until then to do
anything.

>However, the filesystem library doesn't seem to manage mac paths, which
>I still need to do. I've had a look at the code, and it's not really
>clear how one is supposed to add support for new path types.

Mac paths were deliberately not supported in the review version as I didn't
want to ask anyone to do that work, knowing that it would have to be redone
after the formal review.

Mac support will be added by reimplementing the library I guess, unless Mac
OS X has enough POSIX support that the POSIX implementation can be used.

>There's a path object that does windows and unix paths, and a comment
>that this could be implemented differently for other platforms. But
>there's no path superclass or anything.

That's by design, because there is no plan to support several filesystems
at the same time.

>In my implementation, I have a general path object (a vector of strings
>as opposed to a single string, but I don't think that matters), and a
>bunch of path interpreters. When a string gets passed to a path
>constructor, each of the path interpreters has a go at guessing whether
>it can interpret the path. (Or at least that's what it's meant to do,
>it's not quite that elegant).

Remember that the filesystem constructors are either generic path grammar
format or system specific format. So no need to guess, except in the case
of a system which supports multiple system specific formats. There are
such systems; z/OS for example supports something like six distinct
filesystems. But apparently a parser can determine which format is which
by inspection.

>So, how should I go about adding mac support for paths?

1) Wait two weeks or so until POSIX and Windows versions are updated and
stable.
2) Ask the several Mac experts who read this list for help.

At least that is what I've been planning to do:-)

Thanks,

--Beman


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