Boost logo

Boost Users :

Subject: Re: [Boost-users] list all drives
From: Trevor Harmon (Trevor.W.Harmon_at_[hidden])
Date: 2010-07-12 14:24:21


On Jul 11, 2010, at 11:34 PM, Scott McMurray wrote:

> On 11 July 2010 15:50, Daniel Trebbien <dtrebbien_at_[hidden]> wrote:
>>
>> Because the concept of drives is unique to Windows, Boost Filesystem
>> does not implement such a function. Boost Filesystem and all Boost
>> libraries are designed to be cross-platform.
>>
>
> Boost Filesystem paths do have the concept of a "root name", though,
> so it might be logical to have a function that lists them.

Yes, that's how Java handles this problem. Like Boost, it has a cross-
platform I/O library, and so it too must deal with the Windows-only
concept of 26 lettered drives. Its solution is a function that returns
an array of "roots":

http://download.oracle.com/docs/cd/E17409_01/javase/6/docs/api/java/io/File.html#listRoots()

On my Ubuntu desktop, the array is {"/"}, while on my Windows desktop,
it's {"A:\", "C:\", "D:\"}.

Perhaps Boost can adopt a similar approach.

Trevor


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net