2025-02-12 22:11:18 +00:00
|
|
|
#include <blue/io/directory.h>
|
|
|
|
|
#include <stdio.h>
|
|
|
|
|
|
|
|
|
|
#define NRAND_NUMBERS 12
|
|
|
|
|
#define NRAND_BYTES 128
|
|
|
|
|
#define NRAND_DOUBLES 8
|
|
|
|
|
|
|
|
|
|
int main(int argc, const char **argv)
|
|
|
|
|
{
|
|
|
|
|
if (argc < 2) {
|
|
|
|
|
return -1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
b_directory *dir = NULL;
|
|
|
|
|
b_path *path = b_path_create_from_cstr(argv[1]);
|
2025-07-28 22:22:14 +01:00
|
|
|
b_result result = b_directory_open(B_DIRECTORY_ROOT, path, 0, &dir);
|
2025-02-12 22:11:18 +00:00
|
|
|
|
2025-07-28 22:22:14 +01:00
|
|
|
if (b_result_is_error(result)) {
|
|
|
|
|
b_throw(result);
|
2025-02-12 22:11:18 +00:00
|
|
|
return -1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
b_directory_iterator it = {0};
|
|
|
|
|
b_directory_iterator_begin(dir, &it, B_DIRECTORY_ITERATE_PARENT_FIRST);
|
|
|
|
|
while (b_directory_iterator_is_valid(&it)) {
|
2025-02-13 21:36:53 +00:00
|
|
|
printf("%s\n", b_path_ptr(it.filepath));
|
2025-02-12 22:11:18 +00:00
|
|
|
b_directory_iterator_next(&it);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
|
}
|