# Boost :

From: Jeremy Maitin-Shepard (jbms_at_[hidden])
Date: 2004-08-18 13:09:56

Carlo Wood <carlo_at_[hidden]> writes:

> On Wed, Aug 18, 2004 at 12:56:57PM -0400, Jeremy Maitin-Shepard wrote:
>> How does it handle both path formats simultaneously? Does / mean the
>> Cygwin root, while \ means the current drive/volume root? In order to
>> support that, there would probably need to be separate special path
>> handling for Cygwin, so that / and \ can be treated separately. Then
>> there is still the problem of representation in the boost.filesystem
>> "portable" format.

> No, no, no. As I explained in my previous post, what he meant (I assume)
> is that it should handle both types of canonical paths. That is, it should
> understand "/usr" AND "c:/cygwin/usr". As I pointed out, this is possible
> because "/usr" is not complete (but does have a root directory), while the
> other is. This is not ambigious.

The standard Windows path handling code in boost.filesystem treats the
("portable" format) path /usr as the Windows path "\usr", namely the usr
subdirectory of the root directory of the current drive/volume.

> Thus, on cygwin, boost::filesystem should treat "/usr" as "c:/cygwin/usr"
> when compiled with BOOST_WINDOWS (and treat "c:/cygwin/usr" as itself).
> When it would be compiled with BOOST_POSIX then "c:/cygwin/usr" would
> be an illegal path name and "/usr" would be handled internally as "/usr"
> (by calling the POSIX system calls of cygwin).

If it followed these semantics, there would be no reason to define
BOOST_POSIX when compiling Boost for cygwin, since the only effect would
be that certain paths become illegal, no new paths become legal, and all
legal paths refer to the same files. Consider, however, these alternate
semantics for boost filesystem path handling on Cygwin:

When compiled with BOOST_WINDOWS:

"/" refers to the root directory of the current drive/volume

"letter:/" refers to the <letter> drive/volume root directory

When compiled with BOOST_POSIX:

"/" refers to the Cygwin root directory

"letter:/" refers to the <letter> drive/volume root directory

```--
Jeremy Maitin-Shepard

```

• application/pgp-signature attachment: stored