From f3778ae0d550b7fa0c4519a97ca96a0f834f2150 Mon Sep 17 00:00:00 2001 From: Kevin Day Date: Tue, 15 Feb 2022 21:08:42 -0600 Subject: [PATCH] Update: Use F_directory_not instead of F_directory for non-existent directories. Also add documentation. --- level_1/fl_directory/c/directory.c | 12 ++++++------ level_1/fl_directory/c/directory.h | 5 +++++ 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/level_1/fl_directory/c/directory.c b/level_1/fl_directory/c/directory.c index 2642095..526c15f 100644 --- a/level_1/fl_directory/c/directory.c +++ b/level_1/fl_directory/c/directory.c @@ -69,7 +69,7 @@ extern "C" { f_status_t status = f_directory_exists(source); if (F_status_is_error(status)) return status; - if (status == F_false) return F_status_set_error(F_directory); + if (status == F_false) return F_status_set_error(F_directory_not); struct stat source_stat; @@ -150,11 +150,11 @@ extern "C" { f_status_t status = f_directory_exists(source); if (F_status_is_error(status)) return status; - if (status == F_false) return F_status_set_error(F_directory); + if (status == F_false) return F_status_set_error(F_directory_not); status = f_directory_exists(destination); if (F_status_is_error(status)) return status; - if (status == F_false) return F_status_set_error(F_directory); + if (status == F_false) return F_status_set_error(F_directory_not); f_string_static_t static_source = macro_f_string_static_t_initialize2(source.string, source.used); f_string_static_t static_destination = macro_f_string_static_t_initialize2(destination.string, destination.used); @@ -210,7 +210,7 @@ extern "C" { f_status_t status = f_directory_exists(source); if (F_status_is_error(status)) return status; - if (status == F_false) return F_status_set_error(F_directory); + if (status == F_false) return F_status_set_error(F_directory_not); status = f_directory_exists(destination); if (F_status_is_error(status)) return status; @@ -280,11 +280,11 @@ extern "C" { f_status_t status = f_directory_exists(source); if (F_status_is_error(status)) return status; - if (status == F_false) return F_status_set_error(F_directory); + if (status == F_false) return F_status_set_error(F_directory_not); status = f_directory_exists(destination); if (F_status_is_error(status)) return status; - if (status == F_false) return F_status_set_error(F_directory); + if (status == F_false) return F_status_set_error(F_directory_not); f_string_static_t static_source = macro_f_string_static_t_initialize2(source.string, source.used); f_string_static_t static_destination = macro_f_string_static_t_initialize2(destination.string, destination.used); diff --git a/level_1/fl_directory/c/directory.h b/level_1/fl_directory/c/directory.h index 6001911..b904ce7 100644 --- a/level_1/fl_directory/c/directory.h +++ b/level_1/fl_directory/c/directory.h @@ -112,6 +112,7 @@ extern "C" { * F_none on success. * F_data_not if source.used or destination.used is 0. * + * F_directory_not (with error bit) if the source directory does not exist. * F_failure (with error bit) for any other failure, failures might be populated with individual status codes. * * Errors (with error bit) from: f_directory_create(). @@ -155,6 +156,7 @@ extern "C" { * F_none on success. * F_data_not if source.used or destination.used is 0. * + * F_directory_not (with error bit) if either the source or destination directory does not exist. * F_failure (with error bit) for any other failure, failures might be populated with individual status codes. * * Errors (with error bit) from: f_directory_exists(). @@ -190,6 +192,8 @@ extern "C" { * F_none on success. * F_data_not if source.used or destination.used is 0. * + * F_directory_found (with error bit) if the destination directory is found and recurse.exclusive is TRUE. + * F_directory_not (with error bit) if the source directory does not exist. * F_failure (with error bit) for any other failure, failures might be populated with individual status codes. * * Errors (with error bit) from: f_directory_create(). @@ -231,6 +235,7 @@ extern "C" { * F_none on success. * F_data_not if source.used or destination.used is 0. * + * F_directory_not (with error bit) if either the source or the destination directory does not exist. * F_failure (with error bit) for any other failure, failures might be populated with individual status codes. * * Errors (with error bit) from: f_directory_exists(). -- 1.8.3.1