Skip to content

build/api-examples/FileAccess.cpp

Complete program from the FileAccess API reference. Save it at the path shown above and use the build command in the reference page.

Source files · Download FileAccess.cpp

#include "desktop_native.hpp"
#include <cstdio>
#include <cstring>

int main()
{
    gaspardos::desktop::NativeFileAccess       native;
    gaspardos::desktop::FileAccess&            access = native;
    std::vector<gaspardos::desktop::FileEntry> roots  = access.roots();
    std::printf("%lu volumes\n", static_cast<unsigned long>(roots.size()));
    return 0;
}