|
Boost : |
From: Jan Langer (jan_at_[hidden])
Date: 2002-03-07 16:28:45
On Thu, 7 Mar 2002, Stewart, Robert wrote:
>What you've suggested is that the library magically determined that "A:\"
>was the directory of choice (or "/bin" for Posix). I would not want that.
>On the one hand, root_directory() suggests "/" to me for Posix. On the
>other, there is no "root directory" concept on DOS-style filesystems apart
>from that of the current drive. Therefore, the behavior you described
>suggests that root_directory() either relied on the current directory to
>determine the current drive, thus selecting "A:\" if the current directory
>referred to some directory on drive A, or that root_directory() determined a
>priori which drive's root directory it will return. Both seem too "magical"
>to me.
>
>The proposed idea that root_directory() returns a set of available drives
>helps, but I doubt code calling erase() as you've shown above really wants
>to iterate all available drives to delete all files from each. (That would
>make for a simple virus, though!)
actually i want no root_directory () function at all, but a
hierarchy_iterator returning '/' for posix as a single element and all
drive letters beginning with 'a:' (if it exists) for win. this was
proposed by beman in the initial requirements (at least i understood it
this way) and i thought that its a quite good idea. in my last posting
about this problem i just wanted to make clear how unclear and confusing
a directory_iterator (root_directory ()) solution can be. as this
discussion proves, everyone has another opinion on this whereas a
hierarchy_iterator leaves little room for guessing what i returns on
each platform.
-- jan langer ... jan_at_[hidden] "pi ist genau drei"
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk