Boost logo

Boost :

From: Craig Henderson (chenderson_at_[hidden])
Date: 2001-03-28 03:29:28


Oops, my small observation has opened a huge nest of nasties ;-)
My point was more the fact that these differences must be acknowledged -
not necessarily implemented - by a generic Boost solution. The
Boost.Sysutils or whatever you want to call it should be a generic
templated library which abstracts the implementation specific detail to
some kind of traits/policy class, but ultimately provide the library
user with a consistent, reliable and static interface regardless of
platform and compiler. Of course, the traits/policy bit will be
extremely implementation specific, but there is nothing wrong with that,
IMHO.

Cheers
Craig

-----Original Message-----
From: flameframe_at_[hidden] [mailto:flameframe_at_[hidden]]
Sent: 28 March 2001 08:21
To: boost_at_[hidden]
Subject: [boost] Re: candidate for library, "sysutils"

Just a few examples for different OS...
1. absolute file names:

                 host volume directories base ext vers
                ------- ------- --------------- ------- ------- ------

 UNIX /dir1/dir2/ file .ext
 DOS OS/2 NT A: \dir1\dir1\ file .ext
 MAC volume: dir1:dir2: file .ext
 VMS host:: volume: [dir1.dir2] file .ext ;vers

2. relative file names:

 UNIX file ./file dir1/file ./dir1/file ../../dir1/file
 DOS file .\file dir1\file .\dir1\file ..\..\dir1\file
 MAC file :dir1:file :dir1:file :::dir1:file
 VMS file []file [.dir1]file [.dir1]file [--.dir1]file

3. allowed characters in dir/file name:
 UNIX any except '/'.
 DOS OS/2 NT any except most punctuations.
 MAC any except ':'.
 VMS only a-z, A-Z, 0-9, '-', '_' and '$'.

4. Some specifics:
 UNIX :
~ home directory of the current user.
~user home directory of the specified user.

 VMS :
        [000000] top directory of a volume, so
                        [000000.dir1] is equivalent to [dir1]

        [dir1.dir2] directory as a path
        [dir1]dir2.dir directory as a file

I believe it would be more appropriate to pass desired syntax as a
parameter to dirname()/basename(), etc.

Regards,
Vitalij.
--- In boost_at_y..., Matt Austern <austern_at_r...> wrote:
> David Abrahams wrote:
> >
> > The fun's not over yet, kids: MacOS likes ':'!!
> >
> > -Dave
> > ----- Original Message -----
> > From: "Thomas Matelich" <sosedada_at_u...>
> > To: <boost_at_y...>
> > Sent: Tuesday, March 27, 2001 4:56 PM
> > Subject: Re: [boost] candidate for library, "sysutils"
> >
> > > Craig Henderson wrote:
> > >
> > > > It must be taken into account during the design of such a
library, the
> > > > differences between OSs. For example, UNIX '/' and MS '\'. The
> > > > description of the isabs() in the Python doc below
reads "Return true if
> > > > path is an absolute pathname (begins with a slash)." This is
true on
> > > > UNIX, but with MS absolute pathnames can begin with "C:\"
or "\\" for a
> > > > UNC path.
> > >
> > > Just a quick note because people often forget, MS will
accept '/' in your
> > > code. All my dir stuff uses '/' exclusively, converting on the
way in.
> > > Don't bother #ifdef'ing your logic, just the inputs.
>
> And there are other OS's where it starts getting pretty hard
> to have anything that looks like the Unix-ish directory/
> subdirectory model, and where defining a single directory
> separation character isn't good enough. I'm thinking of VMS,
> for example (which can be made to look sort of like DOS/Windows
> if you squint hard enough), and of IBM mainframe OS's, like
> VM/CMS.
>
> The question isn't whether you can come up with a convention
> that supports everything, because the answer is that you
> can't, but rather how much generality you want to support.
>
> --Matt

To unsubscribe, send email to:
<mailto:boost-unsubscribe_at_[hidden]>
 

Your use of Yahoo! Groups is subject to
http://docs.yahoo.com/info/terms/


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