Boost C++ Libraries: Ticket #6884: Add functionality to enumerate filesystem roots https://svn.boost.org/trac10/ticket/6884 <p> Unlike POSIX systems, which root everything at '/', some systems (notably Windows) provide multiple filesystem roots. </p> <p> In order to abstract this difference in a cross-platform way, I propose that a new function be added to boost::filesystem to return a list of path objects, one for each filesystem root. On a POSIX system, this would simply return [&#34;/&#34;], but on Windows, it would return, e.g., ["C:/", "D:/"]. This would make it possible to implement something like a filesystem browser in a platform-independent manner. </p> <p> There is precedence for this functionality in several cross-platform libraries, including Java (File.listRoots), Qt (QDir::drives), and Poco (Poco::Path::listRoots). </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/6884 Trac 1.4.3 Ulrich Eckhardt <ulrich.eckhardt@…> Thu, 10 May 2012 13:55:16 GMT cc set https://svn.boost.org/trac10/ticket/6884#comment:1 https://svn.boost.org/trac10/ticket/6884#comment:1 <ul> <li><strong>cc</strong> <span class="trac-author">ulrich.eckhardt@…</span> added </li> </ul> <p> MS Windows CE also uses a single root "\", so the drive letters are only present </p> <pre class="wiki">#if (defined(_WIN32) || defined(WIN32)) &amp;&amp; !defined(UNDER_CE)}}} </pre><p> Otherwise I agree that this would be a useful addition. OTOH, translating "/C:/" to "C:\" would also be feasible, you could then get the list of drives by listing the content of "/". I'd take it to the developers' mailinglist for discussion. </p> Ticket