Solved exercise 2 - create a simple tree program clone

This commit is contained in:
Fabio Scotto di Santolo
2025-06-30 22:25:31 +02:00
parent 7bc220f92c
commit a629f9de01
6 changed files with 162 additions and 0 deletions

15
exercises/tree/main.c Normal file
View File

@@ -0,0 +1,15 @@
#include <stdio.h>
#include <stdlib.h>
#include "tree.h"
int main(int argc, char *argv[]) {
const char *path = (argc > 1) ? argv[1] : ".";
if (print_tree(path, 0) == -1) {
perror("Error traversing directory");
return EXIT_FAILURE;
}
return EXIT_SUCCESS;
}