summaryrefslogtreecommitdiff
path: root/source/kit/file.c
diff options
context:
space:
mode:
Diffstat (limited to 'source/kit/file.c')
-rw-r--r--source/kit/file.c20
1 files changed, 9 insertions, 11 deletions
diff --git a/source/kit/file.c b/source/kit/file.c
index 08f1888..df94d59 100644
--- a/source/kit/file.c
+++ b/source/kit/file.c
@@ -252,21 +252,11 @@ kit_status_t kit_folder_create(kit_str_t path) {
kit_status_t kit_folder_create_recursive(kit_str_t path) {
for (i32 i = 0;; i++) {
- printf(" * %d * \n", i);
- fflush(stdout);
- printf(" * TAKE * \n");
- fflush(stdout);
str_t part = kit_path_take(path, i);
- printf(" * TYPE * \n");
- fflush(stdout);
- i32 type = kit_path_type(part);
+ i32 type = kit_path_type(part);
if (type == KIT_PATH_FILE)
return KIT_ERROR_FILE_ALREADY_EXISTS;
if (type == KIT_PATH_NONE) {
- printf(" * CREATE * \n");
- fflush(stdout);
- printf(" \"%s\" \n", BS(part));
- fflush(stdout);
kit_status_t s = kit_folder_create(part);
if (s != KIT_OK)
return s;
@@ -423,15 +413,20 @@ kit_path_list_t kit_folder_enum(kit_str_t path,
return result;
}
+ printf(" >> 1 \n"); fflush(stdout);
+
buf[path.size + 4] = '\\';
buf[path.size + 5] = '*';
+ printf(" >> 1 \n"); fflush(stdout);
WIN32_FIND_DATAW data;
HANDLE find = FindFirstFileA(buf, &data);
+ printf(" >> 2 \n"); fflush(stdout);
if (find == INVALID_HANDLE_VALUE)
return result;
+ printf(" >> 3 \n"); fflush(stdout);
do {
i64 n = result.files.size;
DA_RESIZE(result.files, n + 1);
@@ -440,6 +435,7 @@ kit_path_list_t kit_folder_enum(kit_str_t path,
break;
}
+ printf(" >> 4 \n"); fflush(stdout);
i64 size = 0;
while (size < MAX_PATH && data.cFileName[size] != L'\0') size++;
DA_INIT(result.files.values[n], size, alloc);
@@ -449,10 +445,12 @@ kit_path_list_t kit_folder_enum(kit_str_t path,
break;
}
+ printf(" >> 5 \n"); fflush(stdout);
for (i64 i = 0; i < size; i++)
result.files.values[n].values[i] = data.cFileName[i];
} while (FindNextFileA(find, &data) != 0);
+ printf(" >> 6 \n"); fflush(stdout);
FindClose(find);
#else
DIR *directory = opendir(buf);