diff options
Diffstat (limited to 'source/kit/file.c')
-rw-r--r-- | source/kit/file.c | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/source/kit/file.c b/source/kit/file.c index df94d59..52b27fa 100644 --- a/source/kit/file.c +++ b/source/kit/file.c @@ -301,12 +301,15 @@ kit_status_t kit_file_remove_recursive(kit_str_t path, case KIT_PATH_FOLDER: { kit_path_list_t list = kit_folder_enum(path, alloc); + printf(" >> 1 \n"); fflush(stdout); + assert(list.status == KIT_OK); if (list.status != KIT_OK) { kit_path_list_destroy(list); return list.status; } + printf(" >> 2 \n"); fflush(stdout); for (i = 0; i < list.files.size; i++) { str_builder_t full_path = kit_path_join( path, WRAP_STR(list.files.values[i]), alloc); @@ -316,8 +319,10 @@ kit_status_t kit_file_remove_recursive(kit_str_t path, assert(s == KIT_OK); } + printf(" >> 3 \n"); fflush(stdout); kit_path_list_destroy(list); + printf(" >> 4 \n"); fflush(stdout); kit_status_t s = kit_folder_remove(path); assert(s == KIT_OK); return s; @@ -413,20 +418,15 @@ 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); @@ -435,7 +435,6 @@ 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); @@ -445,12 +444,10 @@ 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); |