build/api-examples/DirectoryTree.cpp¶
Complete program from the DirectoryTree API reference. Save it at the path shown above and use the build command in the reference page.
Source files · Download DirectoryTree.cpp
#include "desktop_native.hpp"
#include <cstdio>
#include <cstring>
int main()
{
gaspardos::desktop::NativeFileAccess access;
gaspardos::desktop::DirectoryTree tree(access);
if (!tree.open("/AHCIDISK0"))
return 1;
for (unsigned i = 0; i < 10000 && tree.loading(); ++i)
{
tree.tick();
GO64_yield();
}
return tree.loading() ? 1 : 0;
}