Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- std::vector<std::string> enumerate_filesystems()
- {
- std::vector<std::string> res;
- #ifdef _WIN32
- const DWORD drive_table = GetLogicalDrives();
- for(unsigned n = 0; n < 26; ++n) {
- if((drive_table >> n) & 1) {
- res.emplace_back(2, char(65 + n));
- res.back()[1] = ':';
- }
- }
- #elif !defined(__APPLE__)
- // FIXME: Sensible guesses. It'll be far too much work to implement a more
- // factual version that works reliably across multiple POSIX
- // platforms, at least without adding new build dependencies.
- res.push_back("/home");
- res.push_back("/media");
- res.push_back("/");
- #endif
- return res;
- }
Advertisement
Add Comment
Please, Sign In to add comment