Boost logo

Boost :

From: Beman Dawes (bdawes_at_[hidden])
Date: 2002-08-05 10:09:26


At 09:03 PM 8/4/2002, Chuck Allison wrote:

>The only place I've seen difficulty with '/' in file names is in the
>command
>line in an MS-DOS shell (and in the old days we could even change '\' to
>'/'
>with the SWITCHAR INT20 service). I still routinely use makefiles with
'/'
>targets under Windows XP. Where does it say that the filesystem doesn't
>like
>'/', so I can get up-to-date?

You are up-to-date:-)

The question was whether or not '/' is a valid character as part of a NTFS
file name. It isn't, because NTFS (and a number of other operating systems)
treat '/' as a separator.

Thus,

      "foo/bar"

is always seen as a file named "bar" is a directory named "foo". These
OS's do not allow a file to be named "foo/bar", and their designers choose
not to provide any escape mechanism to say "in this case treat '/' as part
of the name rather than a separator".

I followed the same practice in the Filesystem Library, and provide no
escape to allow a '/' in a filename in the portable format. There is also
an implementation defined "system_specific" constructor, so you can always
construct a name with a '/' in it if the implementation allows it because
of local OS rules.

--Beman

     


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