Tweak the logic to ensure the simulate prints the simulate message only once for the top-most directory and then only for the second simulate pass (which is after the recursion into the directory children).
Make so the `--remember yes` works as intended.
Make the `--remember yes` the default for the `remove` program.
Print the "skip yes" when simulating and remember state causes a skip.
A unit test is failing due to a bug/regression in `kt_remove_operate_recurse_action()`.
I belive this line is the concern:
```
if (!(flag & f_directory_recurse_do_flag_action_d) || !kt_remove_operate_shall_remove(recurse->state.code) && !((main->setting.flag & kt_remove_main_flag_simulate_d) && !recurse->depth)) return;
```
This is not yet addressed.
/**
* Flags associated with performing an operation on a file.
*
- * kt_remove_flag_file_operate_*_d:
- * - none: No flags set.
- * - directory: Is a directory.
- * - empty: Is an empty directory.
- * - follow: Follow the symbolic link.
- * - link: The file being operated on is a link or is a followed link.
- * - missing: The file is not found.
- * - parent: This is a parent of a file for some other file tree operation process.
- * - processed: This path is already processed.
- * - remove: Perform remove.
- * - remove_fail: Cannot perform remove due to failure.
- * - remove_not: Do not remove, but not a failure.
- * - remove_not_fail: Helper used to designate both remove_fail and remove_not being set.
- * - simulate_not: Simulate printing is explicitly disabled for the specific file.
+ * kt_remove_flag_operate_*_d:
+ * - none: No flags set.
+ * - directory: Is a directory.
+ * - empty: Is an empty directory.
+ * - follow: Follow the symbolic link.
+ * - link: The file being operated on is a link or is a followed link.
+ * - missing: The file is not found.
+ * - parent: This is a parent of a file for some other file tree operation process.
+ * - processed: This path is already processed.
+ * - remove: Perform remove.
+ * - remove_fail: Cannot perform remove due to failure.
+ * - remove_not: Do not remove, but not a failure.
+ * - remove_not_fail: Helper used to designate both remove_fail and remove_not being set.
+ * - simulate_not: Simulate printing is explicitly disabled for the specific file.
+ * - top: Designate that this is a top-level directory file.
+ * - top_similate_not: Helper used to designate both simulate_not and top being set.
*/
-#ifndef _di_kt_remove_flag_file_operate_d_
- #define kt_remove_flag_file_operate_none_d 0x0
- #define kt_remove_flag_file_operate_directory_d 0x1
- #define kt_remove_flag_file_operate_empty_d 0x2
- #define kt_remove_flag_file_operate_follow_d 0x4
- #define kt_remove_flag_file_operate_link_d 0x8
- #define kt_remove_flag_file_operate_missing_d 0x10
- #define kt_remove_flag_file_operate_parent_d 0x20
- #define kt_remove_flag_file_operate_processed_d 0x40
- #define kt_remove_flag_file_operate_remove_d 0x80
- #define kt_remove_flag_file_operate_remove_fail_d 0x100
- #define kt_remove_flag_file_operate_remove_not_d 0x200
- #define kt_remove_flag_file_operate_remove_not_fail_d 0x300
- #define kt_remove_flag_file_operate_simulate_not_d 0x400
-#endif // _di_kt_remove_flag_file_operate_d_
+#ifndef _di_kt_remove_flag_operate_d_
+ #define kt_remove_flag_operate_none_d 0x0
+ #define kt_remove_flag_operate_directory_d 0x1
+ #define kt_remove_flag_operate_empty_d 0x2
+ #define kt_remove_flag_operate_follow_d 0x4
+ #define kt_remove_flag_operate_link_d 0x8
+ #define kt_remove_flag_operate_missing_d 0x10
+ #define kt_remove_flag_operate_parent_d 0x20
+ #define kt_remove_flag_operate_processed_d 0x40
+ #define kt_remove_flag_operate_remove_d 0x80
+ #define kt_remove_flag_operate_remove_fail_d 0x100
+ #define kt_remove_flag_operate_remove_not_d 0x200
+ #define kt_remove_flag_operate_remove_not_fail_d 0x300
+ #define kt_remove_flag_operate_simulate_not_d 0x400
+ #define kt_remove_flag_operate_top_d 0x800
+ #define kt_remove_flag_operate_top_simulate_not_d 0xc00
+#endif // _di_kt_remove_flag_operate_d_
/**
* Flags associated with a mode.
const f_string_static_t kt_remove_remove_s = macro_f_string_static_t_initialize_1(KT_REMOVE_remove_s, 0, KT_REMOVE_remove_s_length);
const f_string_static_t kt_remove_root_s = macro_f_string_static_t_initialize_1(KT_REMOVE_root_s, 0, KT_REMOVE_root_s_length);
const f_string_static_t kt_remove_same_s = macro_f_string_static_t_initialize_1(KT_REMOVE_same_s, 0, KT_REMOVE_same_s_length);
+ const f_string_static_t kt_remove_skip_s = macro_f_string_static_t_initialize_1(KT_REMOVE_skip_s, 0, KT_REMOVE_skip_s_length);
const f_string_static_t kt_remove_today_s = macro_f_string_static_t_initialize_1(KT_REMOVE_today_s, 0, KT_REMOVE_today_s_length);
const f_string_static_t kt_remove_tomorrow_s = macro_f_string_static_t_initialize_1(KT_REMOVE_tomorrow_s, 0, KT_REMOVE_tomorrow_s_length);
const f_string_static_t kt_remove_tree_s = macro_f_string_static_t_initialize_1(KT_REMOVE_tree_s, 0, KT_REMOVE_tree_s_length);
#define KT_REMOVE_remove_s "remove"
#define KT_REMOVE_root_s "root"
#define KT_REMOVE_same_s "same"
+ #define KT_REMOVE_skip_s "skip"
#define KT_REMOVE_today_s "today"
#define KT_REMOVE_tomorrow_s "tomorrow"
#define KT_REMOVE_tree_s "tree"
#define KT_REMOVE_remove_s_length 6
#define KT_REMOVE_root_s_length 4
#define KT_REMOVE_same_s_length 4
+ #define KT_REMOVE_skip_s_length 4
#define KT_REMOVE_today_s_length 5
#define KT_REMOVE_tomorrow_s_length 8
#define KT_REMOVE_tree_s_length 4
extern const f_string_static_t kt_remove_remove_s;
extern const f_string_static_t kt_remove_root_s;
extern const f_string_static_t kt_remove_same_s;
+ extern const f_string_static_t kt_remove_skip_s;
extern const f_string_static_t kt_remove_today_s;
extern const f_string_static_t kt_remove_tomorrow_s;
extern const f_string_static_t kt_remove_tree_s;
#ifndef _di_kt_remove_operate_directory_
f_status_t kt_remove_operate_directory(kt_remove_main_t * const main, const f_string_static_t path, const uint32_t flag_operate) {
- if (!kt_remove_operate_shall_remove(flag_operate)) return (flag_operate & kt_remove_flag_file_operate_remove_fail_d) && !(main->setting.flag & kt_remove_main_flag_simulate_d) ? F_status_set_error(F_no) : F_no;
-
// The recurse.state.code flags represent the top-level directory being recursed on.
main->cache.recurse.state.code = (uint64_t) flag_operate;
main->cache.recurse.state.custom = (void *) main;
const uint32_t flag_operate = kt_remove_preprocess_file(main, path, 0, recurse);
if (F_status_is_error(main->setting.state.status)) return main->setting.state.status;
- if (flag_operate & kt_remove_flag_file_operate_processed_d) return F_no;
+ if (flag_operate & kt_remove_flag_operate_processed_d) return F_no;
+
+ if (flag_operate & kt_remove_flag_operate_missing_d) {
+ main->setting.state.status = kt_remove_operate_memory_save(main, path, flag_operate);
+
+ if (F_status_is_error(main->setting.state.status)) {
+ kt_remove_print_error_file(&main->program.error, macro_kt_remove_f(kt_remove_operate_memory_save), path, f_file_operation_process_s, fll_error_file_type_path_e);
+
+ return main->setting.state.status;
+ }
- if (flag_operate & kt_remove_flag_file_operate_missing_d) {
if (!(main->setting.flag & kt_remove_main_flag_force_simulate_d)) {
main->setting.state.status = F_status_set_error(F_file_found_not);
return main->setting.state.status;
}
}
- else if (main->setting.state.status != F_skip) {
+ else {
main->setting.state.status = kt_remove_operate_file_prompt(main, path, flag_operate);
- if (F_status_is_error(main->setting.state.status)) return main->setting.state.status;
+ if (F_status_is_error(main->setting.state.status) || main->setting.state.status == F_skip) return main->setting.state.status;
- return (flag_operate & kt_remove_flag_file_operate_directory_d) && !(recurse & kt_remove_flag_recurse_normal_d)
+ return (flag_operate & kt_remove_flag_operate_directory_d) && !(recurse & kt_remove_flag_recurse_normal_d)
? kt_remove_operate_directory(main, path, flag_operate)
- : !(main->setting.flag & kt_remove_main_flag_simulate_d)
- ? kt_remove_operate_remove(main, path, flag_operate)
- : F_no;
+ : kt_remove_operate_remove(main, path, flag_operate);
}
return F_no;
return;
}
- const uint32_t flag_operate = kt_remove_preprocess_file(main, path, kt_remove_flag_file_operate_parent_d, kt_remove_flag_recurse_none_d);
-
- if (F_status_is_error(main->setting.state.status)) return;
- if (flag_operate & kt_remove_flag_file_operate_processed_d) return;
+ const uint32_t flag_operate = kt_remove_preprocess_file(main, path, kt_remove_flag_operate_parent_d, kt_remove_flag_recurse_none_d);
+ if (F_status_is_error(main->setting.state.status) || (flag_operate & kt_remove_flag_operate_processed_d)) return;
- if (flag_operate & kt_remove_flag_file_operate_missing_d) {
+ if (flag_operate & kt_remove_flag_operate_missing_d) {
if (!(main->setting.flag & kt_remove_main_flag_force_simulate_d)) {
main->setting.state.status = F_status_set_error(F_file_found_not);
return;
}
}
- else if (main->setting.state.status != F_skip) {
+ else {
main->setting.state.status = kt_remove_operate_file_prompt(main, path, flag_operate);
if (F_status_is_error(main->setting.state.status)) return;
- if (!(main->setting.flag & kt_remove_main_flag_simulate_d)) {
+ if (main->setting.state.status != F_skip && !(main->setting.flag & kt_remove_main_flag_simulate_d)) {
kt_remove_operate_remove(main, path, flag_operate);
}
}
main->setting.prompt = 1;
}
else if (main->setting.flag & kt_remove_main_flag_prompt_follow_d) {
- if (!(flag_operate & kt_remove_flag_file_operate_link_d)) return F_okay;
+ if (!(flag_operate & kt_remove_flag_operate_link_d)) return F_okay;
}
if (main->setting.flag & kt_remove_main_flag_simulate_d) return F_okay;
return;
}
- *flag_operate &= ~kt_remove_flag_file_operate_processed_d;
+ *flag_operate &= ~kt_remove_flag_operate_processed_d;
main->setting.state.status = F_okay;
if (main->cache.memory.array[i].string[range.stop] == f_path_separator_s.string[0]) {
if (f_compare_dynamic_partial_dynamic(main->cache.memory.array[i], path, range) == F_equal_to) {
- *flag_operate |= kt_remove_flag_file_operate_processed_d;
+ *flag_operate |= kt_remove_flag_operate_processed_d;
break;
}
}
if (f_compare_dynamic_partial_dynamic(main->cache.memory.array[i], path, range) == F_equal_to) {
- *flag_operate |= kt_remove_flag_file_operate_processed_d;
+ *flag_operate |= kt_remove_flag_operate_processed_d;
break;
}
}
else {
if (f_compare_dynamic(main->cache.memory.array[i], path) == F_equal_to) {
- *flag_operate |= kt_remove_flag_file_operate_processed_d;
+ *flag_operate |= kt_remove_flag_operate_processed_d;
break;
}
if (macro_kt_remove_signal_check(&main->program, &main->setting.state)) return;
if (f_compare_dynamic(main->cache.memory.array[i], path) == F_equal_to) {
- *flag_operate |= kt_remove_flag_file_operate_processed_d;
+ *flag_operate |= kt_remove_flag_operate_processed_d;
break;
}
f_status_t status = f_memory_array_increase(main->setting.state.step_small, sizeof(f_string_dynamic_t), (void **) &main->cache.memory.array, &main->cache.memory.used, &main->cache.memory.size);
// Find any child paths that would be included by this and remove them from the paths list.
- if (F_status_is_error_not(status) && (flag_operate & kt_remove_flag_file_operate_directory_d)) {
+ if (F_status_is_error_not(status) && (flag_operate & kt_remove_flag_operate_directory_d)) {
const f_range_t range = macro_f_range_t_initialize_2(path.used);
f_number_unsigned_t i = 0;
void kt_remove_operate_recurse_action(f_directory_recurse_do_t * const recurse, const f_string_static_t name, const uint32_t flag) {
if (!recurse || !recurse->state.custom || F_status_set_fine(recurse->state.status) == F_interrupt) return;
- if (!kt_remove_operate_shall_remove(recurse->state.code) || !(flag & f_directory_recurse_do_flag_action_d)) return;
kt_remove_main_t * const main = (kt_remove_main_t *) recurse->state.custom;
- recurse->state.status = kt_remove_operate_file(main, recurse->path, recurse->depth ? kt_remove_flag_recurse_normal_d : kt_remove_flag_recurse_normal_parent_d);
+ if (!(flag & f_directory_recurse_do_flag_action_d) || !kt_remove_operate_shall_remove(recurse->state.code) && !((main->setting.flag & kt_remove_main_flag_simulate_d) && !recurse->depth)) return;
+
+ recurse->state.status = kt_remove_operate_file(
+ main,
+ recurse->path,
+ recurse->depth
+ ? kt_remove_flag_recurse_normal_d
+ : kt_remove_flag_recurse_normal_parent_d
+ );
if (F_status_is_error_not(recurse->state.status)) {
recurse->state.status = F_okay;
f_status_t kt_remove_operate_remove(kt_remove_main_t * const main, const f_string_static_t path, const uint32_t flag_operate) {
if (!main) return F_status_set_error(F_parameter);
- if (!kt_remove_operate_shall_remove(flag_operate)) return (flag_operate & kt_remove_flag_file_operate_remove_fail_d) ? F_status_set_error(F_no) : F_no;
+ if (flag_operate & kt_remove_flag_operate_processed_d) return F_no;
- kt_remove_print_debug_operate_file_remove(&main->program.output, path, flag_operate);
+ const uint8_t remove = kt_remove_operate_shall_remove(flag_operate) ? F_true : F_false;
f_status_t status = F_no;
- if (flag_operate & kt_remove_flag_file_operate_follow_d) {
+ if (remove && !(main->setting.flag & kt_remove_main_flag_simulate_d)) {
+ kt_remove_print_debug_operate_file_remove(&main->program.output, path, flag_operate);
+ }
+
+ if (flag_operate & kt_remove_flag_operate_follow_d) {
main->cache.buffer.used = 0;
status = f_file_link_read(path, F_false, &main->cache.buffer);
return status;
}
+
+ status = F_no;
}
- const f_string_static_t target = (flag_operate & kt_remove_flag_file_operate_follow_d) ? main->cache.buffer : path;
+ const f_string_static_t target = (flag_operate & kt_remove_flag_operate_follow_d) ? main->cache.buffer : path;
- status = flag_operate & kt_remove_flag_file_operate_directory_d
- ? f_directory_remove(target, 0, F_false)
- : f_file_remove(target);
+ if (remove && !(main->setting.flag & kt_remove_main_flag_simulate_d)) {
+ status = flag_operate & kt_remove_flag_operate_directory_d
+ ? f_directory_remove(target, 0, F_false)
+ : f_file_remove(target);
- if (F_status_is_error(status)) {
- if (F_status_set_fine(status) == F_directory_empty_not && (flag_operate & kt_remove_flag_file_operate_remove_not_d)) {
- status = F_no;
+ if (F_status_is_error(status)) {
+ if (F_status_set_fine(status) == F_directory_empty_not && (flag_operate & kt_remove_flag_operate_remove_not_d)) {
+ status = F_no;
+ }
+ else {
+ kt_remove_print_error_file_status(
+ &main->program.error,
+ flag_operate & kt_remove_flag_operate_directory_d
+ ? macro_kt_remove_f(f_directory_remove)
+ : macro_kt_remove_f(f_file_remove),
+ flag_operate & kt_remove_flag_operate_follow_d
+ ? main->cache.buffer
+ : path,
+ f_file_operation_delete_s,
+ flag_operate & kt_remove_flag_operate_directory_d
+ ? fll_error_file_type_directory_e
+ : fll_error_file_type_file_e,
+ status
+ );
+ }
}
else {
- kt_remove_print_error_file_status(
- &main->program.error,
- flag_operate & kt_remove_flag_file_operate_directory_d
- ? macro_kt_remove_f(f_directory_remove)
- : macro_kt_remove_f(f_file_remove),
- flag_operate & kt_remove_flag_file_operate_follow_d
- ? main->cache.buffer
- : path,
- f_file_operation_delete_s,
- flag_operate & kt_remove_flag_file_operate_directory_d
- ? fll_error_file_type_directory_e
- : fll_error_file_type_file_e,
- status
- );
+ status = F_yes;
}
}
- else {
- status = F_yes;
- }
- if (status == F_yes) {
- kt_remove_print_verbose_operate_file_remove(&main->program.output, target, flag_operate);
+ if (status == F_yes || (main->setting.flag & kt_remove_main_flag_simulate_d) || !remove) {
+ if (status == F_yes) {
+ kt_remove_print_verbose_operate_file_remove(&main->program.output, target, flag_operate);
+ }
status = kt_remove_operate_memory_save(main, target, flag_operate);
if (F_status_is_error(status)) {
- kt_remove_print_error_file(&main->program.error, macro_kt_remove_f(kt_remove_operate_memory_save), path, f_file_operation_process_s, fll_error_file_type_path_e);
+ kt_remove_print_error_file(&main->program.error, macro_kt_remove_f(kt_remove_operate_memory_save), target, f_file_operation_process_s, fll_error_file_type_path_e);
}
else {
- status = F_yes;
+ status = remove
+ ? main->setting.flag & kt_remove_main_flag_simulate_d
+ ? F_no
+ : F_yes
+ : flag_operate & kt_remove_flag_operate_remove_fail_d
+ ? F_status_set_error(F_no)
+ : F_no;
}
}
#ifndef _di_kt_remove_operate_shall_remove_
f_status_t kt_remove_operate_shall_remove(const uint32_t flag) {
- return (flag & kt_remove_flag_file_operate_remove_d) && !(flag & kt_remove_flag_file_operate_remove_not_fail_d);
+ return (flag & kt_remove_flag_operate_remove_d) && !(flag & kt_remove_flag_operate_remove_not_fail_d);
}
#endif // _di_kt_remove_operate_shall_remove_
* @param path
* The path to the file to operate on.
* @param flag_operate
- * The operate file specific flags from kt_remove_flag_file_operate_*_e.
+ * The operate file specific flags from kt_remove_flag_operate_*_e.
*
* @return
* F_yes on success and file remove.
* Set to kt_remove_flag_recurse_none_d when this function is being called outside of directory recursion.
*
* @return
- * F_yes on success and removed.
- * F_no on success and not removed.
* F_data_not on success but path is an empty string.
+ * F_no on success and not removed.
+ * F_skip on success and the file is not removed because it is being skipped.
+ * F_yes on success and removed.
*
* F_file_found_not (with error bit) on file not found.
* F_interrupt (with error bit) on interrupt.
* @param path
* The path to the file to operate on.
* @param flag_operate
- * The operate file specific flags from kt_remove_flag_file_operate_*_e.
+ * The operate file specific flags from kt_remove_flag_operate_*_e.
*
* @return
* F_okay on success or if prompting is not requested.
* @param path
* The path to the file to operate on.
* @param flag_operate
- * The operate file specific flags from kt_remove_flag_file_operate_*_e.
+ * The operate file specific flags from kt_remove_flag_operate_*_e.
*
- * The kt_remove_flag_file_operate_processed_d is set if the path is found in the memory cache.
+ * The kt_remove_flag_operate_processed_d is set if the path is found in the memory cache.
*
* Must not be NULL.
*
* @param path
* The path to the file to operate on.
* @param flag_operate
- * The operate file specific flags from kt_remove_flag_file_operate_*_e.
+ * The operate file specific flags from kt_remove_flag_operate_*_e.
*
* @return
* F_okay on success.
* @param path
* The path to the file to operate on.
* @param flag_operate
- * The operate file specific flags from kt_remove_flag_file_operate_*_e.
+ * The operate file specific flags from kt_remove_flag_operate_*_e.
*
* @return
* F_no on success but file is not to be removed.
* Errors (with error bit) from: f_file_link_read().
* Errors (with error bit) from: f_file_remove().
*
+ * Errors (with error bit) from: kt_remove_operate_memory_save().
+ *
* @see f_file_link_read()
* @see f_file_remove()
*/
if (macro_kt_remove_signal_check(&main->program, &main->setting.state)) return 0;
- uint32_t flag_out = (main->setting.flag & kt_remove_main_flag_option_type_used_d) ? 0 : kt_remove_flag_file_operate_remove_d;
+ uint32_t flag_out = (main->setting.flag & kt_remove_main_flag_option_type_used_d) ? 0 : kt_remove_flag_operate_remove_d;
kt_remove_operate_memory_check(main, path, &flag_out);
- if (F_status_is_error(main->setting.state.status) || (flag_out & kt_remove_flag_file_operate_processed_d)) return flag_out;
+
+ if (F_status_is_error(main->setting.state.status) || (flag_out & kt_remove_flag_operate_processed_d)) {
+ kt_remove_print_simulate_operate_file(&main->program.output, flag_out, path);
+
+ kt_remove_print_simulate_operate_boolean(&main->program.output, flag_out, kt_remove_skip_s, F_true);
+
+ return flag_out;
+ }
f_number_unsigned_t i = 0;
}
if (main->setting.state.status == F_true) {
- flag_out |= kt_remove_flag_file_operate_link_d;
+ flag_out |= kt_remove_flag_operate_link_d;
}
}
else if (exists == F_false || F_status_is_error(exists)) {
if (exists == F_false) {
kt_remove_print_simulate_operate_boolean(&main->program.output, flag_out, kt_remove_ignore_s, main->setting.flag & kt_remove_main_flag_force_d);
- return kt_remove_flag_file_operate_missing_d;
+ return kt_remove_flag_operate_missing_d;
}
remove_print_warning_file_reason(&main->program.warning, path, kt_remove_print_reason_no_access_s);
if (macro_kt_remove_signal_check(&main->program, &main->setting.state)) return 0;
if (main->setting.flag & kt_remove_main_flag_follow_d) {
- flag_out |= kt_remove_flag_file_operate_follow_d;
+ flag_out |= kt_remove_flag_operate_follow_d;
}
main->setting.state.status = f_file_stat(path, main->setting.flag & kt_remove_main_flag_follow_d, &statistics);
}
if (macro_f_file_type_is_directory(statistics.st_mode)) {
- flag_out |= kt_remove_flag_file_operate_directory_d;
+ flag_out |= kt_remove_flag_operate_directory_d;
}
- if ((flag_out & kt_remove_flag_file_operate_directory_d) && (main->setting.flag & kt_remove_main_flag_recurse_d) && (recurse & kt_remove_flag_recurse_top_d)) {
- flag_out |= kt_remove_flag_file_operate_simulate_not_d;
+ if ((recurse & kt_remove_flag_recurse_top_d) && (flag_out & kt_remove_flag_operate_directory_d)) {
+ flag_out |= kt_remove_flag_operate_top_simulate_not_d;
}
kt_remove_print_simulate_operate_file(&main->program.output, flag_out, path);
if (f_compare_dynamic(f_string_ascii_slash_forward_s, path) == F_equal_to) {
kt_remove_print_error_file_is_a(&main->program.error, path, kt_remove_not_allowed_s, 0);
- flag_out |= kt_remove_flag_file_operate_remove_not_d;
+ flag_out |= kt_remove_flag_operate_remove_not_d;
}
}
kt_remove_preprocess_file_type(main, kt_remove_flag_simulate_none_d, path, macro_f_file_type_is_unknown(statistics.st_mode), f_file_type_name_unknown_s, kt_remove_main_flag_unknown_d, kt_remove_main_flag_unknown_ignore_d, &flag_out);
- if (!(main->setting.flag & kt_remove_main_flag_simulate_d) && (flag_out & kt_remove_flag_file_operate_remove_fail_d)) return flag_out;
+ if (!(main->setting.flag & kt_remove_main_flag_simulate_d) && (flag_out & kt_remove_flag_operate_remove_fail_d)) return flag_out;
if (main->setting.flag & kt_remove_main_flag_user_d) {
for (i = 0; i < main->setting.users.used; ++i) {
kt_remove_print_simulate_operate_id(&main->program.output, flag_out, (f_number_unsigned_t) statistics.st_uid, F_true);
if (i < main->setting.users.used) {
- flag_out |= kt_remove_flag_file_operate_remove_d;
+ flag_out |= kt_remove_flag_operate_remove_d;
}
}
kt_remove_print_simulate_operate_boolean(&main->program.output, flag_out, kt_remove_same_s, statistics.st_uid == geteuid());
if (statistics.st_uid == geteuid()) {
- flag_out |= kt_remove_flag_file_operate_remove_d;
+ flag_out |= kt_remove_flag_operate_remove_d;
}
}
kt_remove_print_simulate_operate_boolean(&main->program.output, flag_out, kt_remove_different_s, statistics.st_uid != geteuid());
if (statistics.st_uid != geteuid()) {
- flag_out |= kt_remove_flag_file_operate_remove_d;
+ flag_out |= kt_remove_flag_operate_remove_d;
}
}
kt_remove_print_simulate_operate_id(&main->program.output, flag_out, (f_number_unsigned_t) statistics.st_gid, F_false);
if (i < main->setting.groups.used) {
- flag_out |= kt_remove_flag_file_operate_remove_d;
+ flag_out |= kt_remove_flag_operate_remove_d;
}
}
}
} // for
- flag_out |= kt_remove_flag_file_operate_remove_d;
+ flag_out |= kt_remove_flag_operate_remove_d;
}
}
if (F_status_is_error(main->setting.state.status)) return flag_out;
if (main->setting.state.status == F_yes) {
- flag_out |= kt_remove_flag_file_operate_remove_d;
+ flag_out |= kt_remove_flag_operate_remove_d;
}
}
- if (flag_out & kt_remove_flag_file_operate_directory_d) {
+ if (flag_out & kt_remove_flag_operate_directory_d) {
main->setting.state.status = f_directory_empty(path);
if (F_status_is_error(main->setting.state.status)) return flag_out;
if (main->setting.state.status == F_true || main->setting.state.status == F_false) {
- kt_remove_print_simulate_operate_boolean(&main->program.output, flag_out, kt_remove_empty_s, main->setting.state.status);
-
if (main->setting.state.status == F_true) {
- flag_out |= kt_remove_flag_file_operate_empty_d;
+ flag_out |= kt_remove_flag_operate_empty_d;
}
- if (!(flag_out & kt_remove_flag_file_operate_remove_not_d)) {
+ kt_remove_print_simulate_operate_boolean(&main->program.output, flag_out, kt_remove_empty_s, main->setting.state.status);
+
+ if (!(flag_out & kt_remove_flag_operate_remove_not_d)) {
if (main->setting.flag & kt_remove_main_flag_empty_all_d) {
if (main->setting.state.status == F_true) {
if (main->setting.flag & kt_remove_main_flag_empty_not_fail_d) {
kt_remove_print_error_file_is_a(&main->program.error, path, kt_remove_empty_s, 0);
- flag_out |= kt_remove_flag_file_operate_remove_fail_d;
+ flag_out |= kt_remove_flag_operate_remove_fail_d;
}
else if (main->setting.flag & kt_remove_main_flag_empty_not_d) {
- flag_out |= kt_remove_flag_file_operate_remove_not_d;
+ flag_out |= kt_remove_flag_operate_remove_not_d;
}
}
else if (main->setting.state.status == F_false) {
if (main->setting.flag & kt_remove_main_flag_empty_only_fail_d) {
kt_remove_print_error_file_is_a(&main->program.error, path, kt_remove_not_empty_s, 0);
- flag_out |= kt_remove_flag_file_operate_remove_fail_d;
+ flag_out |= kt_remove_flag_operate_remove_fail_d;
}
else if (main->setting.flag & kt_remove_main_flag_empty_only_d || !(main->setting.flag & (kt_remove_main_flag_empty_not_d | kt_remove_main_flag_recurse_d))) {
- flag_out |= kt_remove_flag_file_operate_remove_not_d;
+ flag_out |= kt_remove_flag_operate_remove_not_d;
}
}
}
if (!(main->setting.flag & kt_remove_main_flag_recurse_d)) {
kt_remove_print_error_file_is_a(&main->program.error, path, kt_remove_not_empty_s, 0);
- flag_out |= kt_remove_flag_file_operate_remove_fail_d;
+ flag_out |= kt_remove_flag_operate_remove_fail_d;
}
}
}
}
}
- if (flag_out & kt_remove_flag_file_operate_directory_d) {
- kt_remove_print_simulate_operate_boolean(&main->program.output, flag_out, kt_remove_recurse_s, (main->setting.flag & kt_remove_main_flag_recurse_d) && !(flag_operate & kt_remove_flag_file_operate_parent_d));
+ if (flag_out & kt_remove_flag_operate_directory_d) {
+ kt_remove_print_simulate_operate_boolean(&main->program.output, flag_out, kt_remove_recurse_s, (main->setting.flag & kt_remove_main_flag_recurse_d) && !(flag_operate & kt_remove_flag_operate_parent_d));
}
if (main->setting.flag & kt_remove_main_flag_tree_d) {
- kt_remove_print_simulate_operate_boolean(&main->program.output, flag_out, kt_remove_parent_s, flag_operate & kt_remove_flag_file_operate_parent_d);
+ kt_remove_print_simulate_operate_boolean(&main->program.output, flag_out, kt_remove_parent_s, flag_operate & kt_remove_flag_operate_parent_d);
}
if (main->setting.flag & kt_remove_main_flag_prompt_all_d) {
kt_remove_print_simulate_operate_boolean(&main->program.output, flag_out, kt_remove_prompt_s, main->setting.flag & kt_remove_main_flag_prompt_each_d);
}
else if (main->setting.flag & kt_remove_main_flag_prompt_follow_d) {
- kt_remove_print_simulate_operate_boolean(&main->program.output, flag_out, kt_remove_prompt_s, (main->setting.flag & kt_remove_main_flag_follow_d) && (flag_out & kt_remove_flag_file_operate_link_d));
+ kt_remove_print_simulate_operate_boolean(&main->program.output, flag_out, kt_remove_prompt_s, (main->setting.flag & kt_remove_main_flag_follow_d) && (flag_out & kt_remove_flag_operate_link_d));
}
else if (main->setting.flag & kt_remove_main_flag_prompt_once_d) {
kt_remove_print_simulate_operate_boolean(&main->program.output, flag_out, kt_remove_prompt_s, !(main->setting.prompt));
if (is) {
if (main->setting.flag & type) {
- *flag_out |= kt_remove_flag_file_operate_remove_d;
+ *flag_out |= kt_remove_flag_operate_remove_d;
}
else if (main->setting.flag & kt_remove_main_flag_option_type_d) {
kt_remove_print_error_file_is_a(&main->program.error, path, name, simulate & kt_remove_flag_simulate_is_a_file_d);
- *flag_out |= kt_remove_flag_file_operate_remove_fail_d;
+ *flag_out |= kt_remove_flag_operate_remove_fail_d;
}
}
* @param path
* The path to the file to operate on.
* @param flag_operate
- * The operate file specific flags from kt_remove_flag_file_operate_*_e.
+ * The operate file specific flags from kt_remove_flag_operate_*_e.
* @param recurse
* One of the kt_remove_flag_recurse_*_d flags.
* Set to kt_remove_flag_recurse_none_d when this function is being called outside of directory recursion.
* @param path
* The path to the file to operate on.
* @param flag_operate
- * The operate file specific flags from kt_remove_flag_file_operate_*_e.
+ * The operate file specific flags from kt_remove_flag_operate_*_e.
* @param statistics
* The already loaded file statistics.
*/
kt_remove_main_t * const main = (kt_remove_main_t *) print->custom;
- if (!(main->setting.flag & kt_remove_main_flag_simulate_d) || (flag_operate & kt_remove_flag_file_operate_simulate_not_d)) return F_output_not;
+ if (!(main->setting.flag & kt_remove_main_flag_simulate_d) || (flag_operate & kt_remove_flag_operate_simulate_not_d)) return F_output_not;
fll_print_format(" %r %r%r", print->to, name, yes ? kt_remove_yes_s : kt_remove_no_s, f_string_eol_s);
kt_remove_main_t * const main = (kt_remove_main_t *) print->custom;
- if (!(main->setting.flag & kt_remove_main_flag_simulate_d) || (flag_operate & kt_remove_flag_file_operate_simulate_not_d)) return F_output_not;
+ if (!(main->setting.flag & kt_remove_main_flag_simulate_d) || (flag_operate & kt_remove_flag_operate_simulate_not_d)) return F_output_not;
const f_number_unsigned_t match_year = kt_remove_time_year_unix_epoch_d + (time.tv_sec / kt_remove_time_seconds_in_year_d);
const f_number_unsigned_t match_second = time.tv_sec % kt_remove_time_seconds_in_year_d;
kt_remove_main_t * const main = (kt_remove_main_t *) print->custom;
- if (!(main->setting.flag & kt_remove_main_flag_simulate_d) || (flag_operate & kt_remove_flag_file_operate_simulate_not_d)) return F_output_not;
+ if (!(main->setting.flag & kt_remove_main_flag_simulate_d) || (flag_operate & kt_remove_flag_operate_simulate_not_d)) return F_output_not;
fll_print_format("%r%[Remove '%Q'%]:%r", print->to, f_string_eol_s, print->set->notable, path, print->set->notable, f_string_eol_s);
kt_remove_main_t * const main = (kt_remove_main_t *) print->custom;
- if (!(main->setting.flag & kt_remove_main_flag_simulate_d) || (flag_operate & kt_remove_flag_file_operate_simulate_not_d)) return F_output_not;
+ if (!(main->setting.flag & kt_remove_main_flag_simulate_d) || (flag_operate & kt_remove_flag_operate_simulate_not_d)) return F_output_not;
if (F_status_is_error(exists)) {
fl_print_format(" file_access_failure %ui%r", print->to, F_status_set_fine(exists), f_string_eol_s);
return F_status_set_error(F_output_not);
}
- if (flag_operate & kt_remove_flag_file_operate_link_d) {
+ if (flag_operate & kt_remove_flag_operate_link_d) {
main->cache.buffer.used = 0;
const f_status_t status = f_file_link_read(path, F_false, &main->cache.buffer);
kt_remove_main_t * const main = (kt_remove_main_t *) print->custom;
- if (!(main->setting.flag & kt_remove_main_flag_simulate_d) || (flag_operate & kt_remove_flag_file_operate_simulate_not_d)) return F_output_not;
+ if (!(main->setting.flag & kt_remove_main_flag_simulate_d) || (flag_operate & kt_remove_flag_operate_simulate_not_d)) return F_output_not;
fll_print_format(" %r %un%r", print->to, is_user ? kt_remove_user_s : kt_remove_group_s, id, f_string_eol_s);
kt_remove_main_t * const main = (kt_remove_main_t *) print->custom;
- if (!(main->setting.flag & kt_remove_main_flag_simulate_d) || (flag_operate & kt_remove_flag_file_operate_simulate_not_d)) return F_output_not;
+ if (!(main->setting.flag & kt_remove_main_flag_simulate_d) || (flag_operate & kt_remove_flag_operate_simulate_not_d)) return F_output_not;
if (match.used) {
fll_print_format(" mode_matched %Q %@03un%r", print->to, match, mode, f_string_eol_s);
*
* This does not alter print.custom.setting.state.status.
* @param flag_operate
- * The operate file specific flags from kt_remove_flag_file_operate_*_e.
+ * The operate file specific flags from kt_remove_flag_operate_*_e.
* @param name
* The name to be associated with the boolean value.
* @param yes
*
* This does not alter print.custom.setting.state.status.
* @param flag_operate
- * The operate file specific flags from kt_remove_flag_file_operate_*_e.
+ * The operate file specific flags from kt_remove_flag_operate_*_e.
* @param name
* The name to be associated with the boolean value.
* @param yes
*
* This does not alter print.custom.setting.state.status.
* @param flag_operate
- * The operate file specific flags from kt_remove_flag_file_operate_*_e.
+ * The operate file specific flags from kt_remove_flag_operate_*_e.
* @param path
* The path to the file to operate on.
*
*
* This does not alter print.custom.setting.state.status.
* @param flag_operate
- * The operate file specific flags from kt_remove_flag_file_operate_*_e.
+ * The operate file specific flags from kt_remove_flag_operate_*_e.
*
- * The kt_remove_flag_file_operate_link_d is of specific interest here.
+ * The kt_remove_flag_operate_link_d is of specific interest here.
* @param path
* The path to the file to operate on.
* @param exists
*
* This does not alter print.custom.setting.state.status.
* @param flag_operate
- * The operate file specific flags from kt_remove_flag_file_operate_*_e.
+ * The operate file specific flags from kt_remove_flag_operate_*_e.
* @param id
* The user or group ID.
* @param is_user
*
* This does not alter print.custom.setting.state.status.
* @param flag_operate
- * The operate file specific flags from kt_remove_flag_file_operate_*_e.
+ * The operate file specific flags from kt_remove_flag_operate_*_e.
* @param mode
* The mode of the file.
* @param match
data.call.print_help = &kt_remove_print_message_help;
#ifdef _en_kt_default_to_utc_
- data.setting.flag |= kt_remove_flag_utc_d;
+ data.setting.flag |= kt_remove_main_flag_utc_d;
#endif // _en_kt_default_to_utc_
+ data.setting.flag |= kt_remove_main_flag_remember_d;
+
f_console_parameter_t parameters[] = kt_remove_console_parameter_t_initialize;
data.program.parameters.array = parameters;
data.call.print_help = &kt_remove_rm_print_message_help;
#ifdef _en_kt_default_to_utc_
- data.setting.flag |= kt_remove_flag_utc_d;
+ data.setting.flag |= kt_remove_main_flag_utc_d;
#endif // _en_kt_default_to_utc_
f_console_parameter_t parameters[] = kt_remove_rm_console_parameter_t_initialize;
data.call.print_help = &kt_remove_rmdir_print_message_help;
#ifdef _en_kt_default_to_utc_
- data.setting.flag |= kt_remove_flag_utc_d;
+ data.setting.flag |= kt_remove_main_flag_utc_d;
#endif // _en_kt_default_to_utc_
f_console_parameter_t parameters[] = kt_remove_rmdir_console_parameter_t_initialize;
data.call.print_help = &kt_remove_unlink_print_message_help;
#ifdef _en_kt_default_to_utc_
- data.setting.flag |= kt_remove_flag_utc_d;
+ data.setting.flag |= kt_remove_main_flag_utc_d;
#endif // _en_kt_default_to_utc_
f_console_parameter_t parameters[] = kt_remove_unlink_console_parameter_t_initialize;
data.call.print_help = &kt_remove_print_message_help;
#ifdef _en_kt_default_to_utc_
- data.setting.flag |= kt_remove_flag_utc_d;
+ data.setting.flag |= kt_remove_main_flag_utc_d;
#endif // _en_kt_default_to_utc_
f_console_parameter_t parameters[] = kt_remove_console_parameter_t_initialize;
uint8_t date = 0;
uint8_t param = 0;
- for (; type < types_total; ++type) {
+ for (type = 0; type < types_total; ++type) {
for (date = 0; date < dates_total; ++date) {
if (macro_f_file_type_is_directory(stats[type].st_mode)) {
will_return(__wrap_f_directory_empty, F_true);
+
+ will_return(__wrap_fl_directory_do, 1);
+ will_return(__wrap_fl_directory_do, &target);
+ will_return(__wrap_fl_directory_do, &target);
+ will_return(__wrap_fl_directory_do, f_directory_recurse_do_flag_action_d | f_directory_recurse_do_flag_directory_d);
}
if (time_spec_removes[date]) {
if (macro_f_file_type_is_directory(stats[type].st_mode)) {
- will_return(__wrap_fl_directory_do, 1);
- will_return(__wrap_fl_directory_do, &target);
- will_return(__wrap_fl_directory_do, &target);
- will_return(__wrap_fl_directory_do, f_directory_recurse_do_flag_action_d | f_directory_recurse_do_flag_directory_d);
// The pre-process gets called again before the final removal for directories.
will_return(__wrap_f_file_exists, F_true);
will_return(__wrap_f_time_clock_get, &time_spec_clocks);
will_return(__wrap_f_time_clock_get, F_okay);
+ if (macro_f_file_type_is_directory(stats[type].st_mode)) {
+ will_return(__wrap_fl_directory_do, 1);
+ will_return(__wrap_fl_directory_do, &target);
+ will_return(__wrap_fl_directory_do, &target);
+ will_return(__wrap_fl_directory_do, f_directory_recurse_do_flag_action_d | f_directory_recurse_do_flag_directory_d);
+ }
+
if (time_spec_removes[date]) {
if (macro_f_file_type_is_directory(stats[type].st_mode)) {
- will_return(__wrap_fl_directory_do, 1);
- will_return(__wrap_fl_directory_do, &target);
- will_return(__wrap_fl_directory_do, &target);
- will_return(__wrap_fl_directory_do, f_directory_recurse_do_flag_action_d | f_directory_recurse_do_flag_directory_d);
// The pre-process gets called again before the final removal for directories.
will_return(__wrap_f_file_exists, F_true);
will_return(__wrap_f_time_clock_get, &time_spec_clocks);
will_return(__wrap_f_time_clock_get, F_okay);
+ if (macro_f_file_type_is_directory(stats[type].st_mode)) {
+ will_return(__wrap_fl_directory_do, 1);
+ will_return(__wrap_fl_directory_do, &target);
+ will_return(__wrap_fl_directory_do, &target);
+ will_return(__wrap_fl_directory_do, f_directory_recurse_do_flag_action_d | f_directory_recurse_do_flag_directory_d);
+ }
+
if (time_spec_removes[date]) {
if (macro_f_file_type_is_directory(stats[type].st_mode)) {
- will_return(__wrap_fl_directory_do, 1);
- will_return(__wrap_fl_directory_do, &target);
- will_return(__wrap_fl_directory_do, &target);
- will_return(__wrap_fl_directory_do, f_directory_recurse_do_flag_action_d | f_directory_recurse_do_flag_directory_d);
// The pre-process gets called again before the final removal for directories.
will_return(__wrap_f_file_exists, F_true);
will_return(__wrap_f_time_clock_get, &time_spec_clocks);
will_return(__wrap_f_time_clock_get, F_okay);
+ if (macro_f_file_type_is_directory(stats[type].st_mode)) {
+ will_return(__wrap_fl_directory_do, 1);
+ will_return(__wrap_fl_directory_do, &target);
+ will_return(__wrap_fl_directory_do, &target);
+ will_return(__wrap_fl_directory_do, f_directory_recurse_do_flag_action_d | f_directory_recurse_do_flag_directory_d);
+ }
+
if (time_spec_removes[date]) {
if (macro_f_file_type_is_directory(stats[type].st_mode)) {
- will_return(__wrap_fl_directory_do, 1);
- will_return(__wrap_fl_directory_do, &target);
- will_return(__wrap_fl_directory_do, &target);
- will_return(__wrap_fl_directory_do, f_directory_recurse_do_flag_action_d | f_directory_recurse_do_flag_directory_d);
// The pre-process gets called again before the final removal for directories.
will_return(__wrap_f_file_exists, F_true);
will_return(__wrap_f_time_clock_get, &time_spec_clocks);
will_return(__wrap_f_time_clock_get, F_okay);
+ if (macro_f_file_type_is_directory(stats[type].st_mode)) {
+ will_return(__wrap_fl_directory_do, 1);
+ will_return(__wrap_fl_directory_do, &target);
+ will_return(__wrap_fl_directory_do, &target);
+ will_return(__wrap_fl_directory_do, f_directory_recurse_do_flag_action_d | f_directory_recurse_do_flag_directory_d);
+ }
+
if (time_spec_removes[date]) {
if (macro_f_file_type_is_directory(stats[type].st_mode)) {
- will_return(__wrap_fl_directory_do, 1);
- will_return(__wrap_fl_directory_do, &target);
- will_return(__wrap_fl_directory_do, &target);
- will_return(__wrap_fl_directory_do, f_directory_recurse_do_flag_action_d | f_directory_recurse_do_flag_directory_d);
// The pre-process gets called again before the final removal for directories.
will_return(__wrap_f_file_exists, F_true);
if (macro_f_file_type_is_directory(stats[type].st_mode)) {
will_return(__wrap_f_directory_empty, F_true);
+
+ will_return(__wrap_fl_directory_do, 1);
+ will_return(__wrap_fl_directory_do, &target);
+ will_return(__wrap_fl_directory_do, &target);
+ will_return(__wrap_fl_directory_do, f_directory_recurse_do_flag_action_d | f_directory_recurse_do_flag_directory_d);
}
if (time_spec_removes[date]) {
if (macro_f_file_type_is_directory(stats[type].st_mode)) {
- will_return(__wrap_fl_directory_do, 1);
- will_return(__wrap_fl_directory_do, &target);
- will_return(__wrap_fl_directory_do, &target);
- will_return(__wrap_fl_directory_do, f_directory_recurse_do_flag_action_d | f_directory_recurse_do_flag_directory_d);
// The pre-process gets called again before the final removal for directories.
will_return(__wrap_f_file_exists, F_true);
will_return(__wrap_f_time_clock_get, &time_spec_clocks);
will_return(__wrap_f_time_clock_get, F_okay);
+ if (macro_f_file_type_is_directory(stats[type].st_mode)) {
+ will_return(__wrap_fl_directory_do, 1);
+ will_return(__wrap_fl_directory_do, &target);
+ will_return(__wrap_fl_directory_do, &target);
+ will_return(__wrap_fl_directory_do, f_directory_recurse_do_flag_action_d | f_directory_recurse_do_flag_directory_d);
+ }
+
if (time_spec_removes[date]) {
if (macro_f_file_type_is_directory(stats[type].st_mode)) {
- will_return(__wrap_fl_directory_do, 1);
- will_return(__wrap_fl_directory_do, &target);
- will_return(__wrap_fl_directory_do, &target);
- will_return(__wrap_fl_directory_do, f_directory_recurse_do_flag_action_d | f_directory_recurse_do_flag_directory_d);
// The pre-process gets called again before the final removal for directories.
will_return(__wrap_f_file_exists, F_true);
will_return(__wrap_f_time_clock_get, &time_spec_clocks);
will_return(__wrap_f_time_clock_get, F_okay);
+ if (macro_f_file_type_is_directory(stats[type].st_mode)) {
+ will_return(__wrap_fl_directory_do, 1);
+ will_return(__wrap_fl_directory_do, &target);
+ will_return(__wrap_fl_directory_do, &target);
+ will_return(__wrap_fl_directory_do, f_directory_recurse_do_flag_action_d | f_directory_recurse_do_flag_directory_d);
+ }
+
if (time_spec_removes[date]) {
if (macro_f_file_type_is_directory(stats[type].st_mode)) {
- will_return(__wrap_fl_directory_do, 1);
- will_return(__wrap_fl_directory_do, &target);
- will_return(__wrap_fl_directory_do, &target);
- will_return(__wrap_fl_directory_do, f_directory_recurse_do_flag_action_d | f_directory_recurse_do_flag_directory_d);
// The pre-process gets called again before the final removal for directories.
will_return(__wrap_f_file_exists, F_true);
will_return(__wrap_f_time_clock_get, &time_spec_clocks);
will_return(__wrap_f_time_clock_get, F_okay);
+ if (macro_f_file_type_is_directory(stats[type].st_mode)) {
+ will_return(__wrap_fl_directory_do, 1);
+ will_return(__wrap_fl_directory_do, &target);
+ will_return(__wrap_fl_directory_do, &target);
+ will_return(__wrap_fl_directory_do, f_directory_recurse_do_flag_action_d | f_directory_recurse_do_flag_directory_d);
+ }
+
if (time_spec_removes[date]) {
if (macro_f_file_type_is_directory(stats[type].st_mode)) {
- will_return(__wrap_fl_directory_do, 1);
- will_return(__wrap_fl_directory_do, &target);
- will_return(__wrap_fl_directory_do, &target);
- will_return(__wrap_fl_directory_do, f_directory_recurse_do_flag_action_d | f_directory_recurse_do_flag_directory_d);
// The pre-process gets called again before the final removal for directories.
will_return(__wrap_f_file_exists, F_true);
will_return(__wrap_f_time_clock_get, &time_spec_clocks);
will_return(__wrap_f_time_clock_get, F_okay);
+ if (macro_f_file_type_is_directory(stats[type].st_mode)) {
+ will_return(__wrap_fl_directory_do, 1);
+ will_return(__wrap_fl_directory_do, &target);
+ will_return(__wrap_fl_directory_do, &target);
+ will_return(__wrap_fl_directory_do, f_directory_recurse_do_flag_action_d | f_directory_recurse_do_flag_directory_d);
+ }
+
if (time_spec_removes[date]) {
if (macro_f_file_type_is_directory(stats[type].st_mode)) {
- will_return(__wrap_fl_directory_do, 1);
- will_return(__wrap_fl_directory_do, &target);
- will_return(__wrap_fl_directory_do, &target);
- will_return(__wrap_fl_directory_do, f_directory_recurse_do_flag_action_d | f_directory_recurse_do_flag_directory_d);
// The pre-process gets called again before the final removal for directories.
will_return(__wrap_f_file_exists, F_true);
if (macro_f_file_type_is_directory(stats[type].st_mode)) {
will_return(__wrap_f_directory_empty, F_true);
+
+ will_return(__wrap_fl_directory_do, 1);
+ will_return(__wrap_fl_directory_do, &target);
+ will_return(__wrap_fl_directory_do, &target);
+ will_return(__wrap_fl_directory_do, f_directory_recurse_do_flag_action_d | f_directory_recurse_do_flag_directory_d);
}
if (time_spec_removes[date]) {
if (macro_f_file_type_is_directory(stats[type].st_mode)) {
- will_return(__wrap_fl_directory_do, 1);
- will_return(__wrap_fl_directory_do, &target);
- will_return(__wrap_fl_directory_do, &target);
- will_return(__wrap_fl_directory_do, f_directory_recurse_do_flag_action_d | f_directory_recurse_do_flag_directory_d);
// The pre-process gets called again before the final removal for directories.
will_return(__wrap_f_file_exists, F_true);
will_return(__wrap_f_time_clock_get, &time_spec_clocks);
will_return(__wrap_f_time_clock_get, F_okay);
+ if (macro_f_file_type_is_directory(stats[type].st_mode)) {
+ will_return(__wrap_fl_directory_do, 1);
+ will_return(__wrap_fl_directory_do, &target);
+ will_return(__wrap_fl_directory_do, &target);
+ will_return(__wrap_fl_directory_do, f_directory_recurse_do_flag_action_d | f_directory_recurse_do_flag_directory_d);
+ }
+
if (time_spec_removes[date]) {
if (macro_f_file_type_is_directory(stats[type].st_mode)) {
- will_return(__wrap_fl_directory_do, 1);
- will_return(__wrap_fl_directory_do, &target);
- will_return(__wrap_fl_directory_do, &target);
- will_return(__wrap_fl_directory_do, f_directory_recurse_do_flag_action_d | f_directory_recurse_do_flag_directory_d);
// The pre-process gets called again before the final removal for directories.
will_return(__wrap_f_file_exists, F_true);
will_return(__wrap_f_time_clock_get, &time_spec_clocks);
will_return(__wrap_f_time_clock_get, F_okay);
+ if (macro_f_file_type_is_directory(stats[type].st_mode)) {
+ will_return(__wrap_fl_directory_do, 1);
+ will_return(__wrap_fl_directory_do, &target);
+ will_return(__wrap_fl_directory_do, &target);
+ will_return(__wrap_fl_directory_do, f_directory_recurse_do_flag_action_d | f_directory_recurse_do_flag_directory_d);
+ }
+
if (time_spec_removes[date]) {
if (macro_f_file_type_is_directory(stats[type].st_mode)) {
- will_return(__wrap_fl_directory_do, 1);
- will_return(__wrap_fl_directory_do, &target);
- will_return(__wrap_fl_directory_do, &target);
- will_return(__wrap_fl_directory_do, f_directory_recurse_do_flag_action_d | f_directory_recurse_do_flag_directory_d);
// The pre-process gets called again before the final removal for directories.
will_return(__wrap_f_file_exists, F_true);
will_return(__wrap_f_time_clock_get, &time_spec_clocks);
will_return(__wrap_f_time_clock_get, F_okay);
+ if (macro_f_file_type_is_directory(stats[type].st_mode)) {
+ will_return(__wrap_fl_directory_do, 1);
+ will_return(__wrap_fl_directory_do, &target);
+ will_return(__wrap_fl_directory_do, &target);
+ will_return(__wrap_fl_directory_do, f_directory_recurse_do_flag_action_d | f_directory_recurse_do_flag_directory_d);
+ }
+
if (time_spec_removes[date]) {
if (macro_f_file_type_is_directory(stats[type].st_mode)) {
- will_return(__wrap_fl_directory_do, 1);
- will_return(__wrap_fl_directory_do, &target);
- will_return(__wrap_fl_directory_do, &target);
- will_return(__wrap_fl_directory_do, f_directory_recurse_do_flag_action_d | f_directory_recurse_do_flag_directory_d);
// The pre-process gets called again before the final removal for directories.
will_return(__wrap_f_file_exists, F_true);
will_return(__wrap_f_time_clock_get, &time_spec_clocks);
will_return(__wrap_f_time_clock_get, F_okay);
+ if (macro_f_file_type_is_directory(stats[type].st_mode)) {
+ will_return(__wrap_fl_directory_do, 1);
+ will_return(__wrap_fl_directory_do, &target);
+ will_return(__wrap_fl_directory_do, &target);
+ will_return(__wrap_fl_directory_do, f_directory_recurse_do_flag_action_d | f_directory_recurse_do_flag_directory_d);
+ }
+
if (time_spec_removes[date]) {
if (macro_f_file_type_is_directory(stats[type].st_mode)) {
- will_return(__wrap_fl_directory_do, 1);
- will_return(__wrap_fl_directory_do, &target);
- will_return(__wrap_fl_directory_do, &target);
- will_return(__wrap_fl_directory_do, f_directory_recurse_do_flag_action_d | f_directory_recurse_do_flag_directory_d);
// The pre-process gets called again before the final removal for directories.
will_return(__wrap_f_file_exists, F_true);
const f_string_t argv[] = { "mocked_main", target.string, 0 };
memset(&statistics, 0, sizeof(struct stat));
- statistics.st_mode = F_file_mode_all_d | F_file_type_directory_d; // Should result in kt_remove_flag_file_operate_remove_d.
+ statistics.st_mode = F_file_mode_all_d | F_file_type_directory_d; // Should result in kt_remove_flag_operate_remove_d.
// Pre-process target.
will_return(__wrap_f_file_exists, F_true);
- will_return(__wrap_f_file_is, F_true); // A link, kt_remove_flag_file_operate_link_d is set.
+ will_return(__wrap_f_file_is, F_true); // A link, kt_remove_flag_operate_link_d is set.
will_return(__wrap_f_file_stat, &statistics);
will_return(__wrap_f_file_stat, F_okay);
const f_string_t argv[] = { "mocked_main", target.string, "+" F_console_standard_short_verbose_s, 0 };
memset(&statistics, 0, sizeof(struct stat));
- statistics.st_mode = F_file_mode_all_d | F_file_type_directory_d; // Should result in kt_remove_flag_file_operate_remove_d.
+ statistics.st_mode = F_file_mode_all_d | F_file_type_directory_d; // Should result in kt_remove_flag_operate_remove_d.
// Pre-process target.
will_return(__wrap_f_file_exists, F_true);
- will_return(__wrap_f_file_is, F_true); // A link, kt_remove_flag_file_operate_link_d is set.
+ will_return(__wrap_f_file_is, F_true); // A link, kt_remove_flag_operate_link_d is set.
will_return(__wrap_f_file_stat, &statistics);
will_return(__wrap_f_file_stat, F_okay);
const f_string_t argv[] = { "mocked_main", target.string, "+" F_console_standard_short_debug_s, 0 };
memset(&statistics, 0, sizeof(struct stat));
- statistics.st_mode = F_file_mode_all_d | F_file_type_directory_d; // Should result in kt_remove_flag_file_operate_remove_d.
+ statistics.st_mode = F_file_mode_all_d | F_file_type_directory_d; // Should result in kt_remove_flag_operate_remove_d.
// Pre-process target.
will_return(__wrap_f_file_exists, F_true);
- will_return(__wrap_f_file_is, F_true); // A link, kt_remove_flag_file_operate_link_d is set.
+ will_return(__wrap_f_file_is, F_true); // A link, kt_remove_flag_operate_link_d is set.
will_return(__wrap_f_file_stat, &statistics);
will_return(__wrap_f_file_stat, F_okay);
const f_string_t argv[] = { "mocked_main", target.string, 0 };
memset(&statistics, 0, sizeof(struct stat));
- statistics.st_mode = F_file_mode_all_d | F_file_type_directory_d; // Should result in kt_remove_flag_file_operate_remove_d.
+ statistics.st_mode = F_file_mode_all_d | F_file_type_directory_d; // Should result in kt_remove_flag_operate_remove_d.
// Pre-process target.
will_return(__wrap_f_file_exists, F_true);
- will_return(__wrap_f_file_is, F_false); // Not a link, kt_remove_flag_file_operate_link_d is not set.
+ will_return(__wrap_f_file_is, F_false); // Not a link, kt_remove_flag_operate_link_d is not set.
will_return(__wrap_f_file_stat, &statistics);
will_return(__wrap_f_file_stat, F_okay);
const f_string_t argv[] = { "mocked_main", target.string, "+" F_console_standard_short_verbose_s, 0 };
memset(&statistics, 0, sizeof(struct stat));
- statistics.st_mode = F_file_mode_all_d | F_file_type_directory_d; // Should result in kt_remove_flag_file_operate_remove_d.
+ statistics.st_mode = F_file_mode_all_d | F_file_type_directory_d; // Should result in kt_remove_flag_operate_remove_d.
// Pre-process target.
will_return(__wrap_f_file_exists, F_true);
- will_return(__wrap_f_file_is, F_false); // Not a link, kt_remove_flag_file_operate_link_d is not set.
+ will_return(__wrap_f_file_is, F_false); // Not a link, kt_remove_flag_operate_link_d is not set.
will_return(__wrap_f_file_stat, &statistics);
will_return(__wrap_f_file_stat, F_okay);
const f_string_t argv[] = { "mocked_main", target.string, "+" F_console_standard_short_debug_s, 0 };
memset(&statistics, 0, sizeof(struct stat));
- statistics.st_mode = F_file_mode_all_d | F_file_type_directory_d; // Should result in kt_remove_flag_file_operate_remove_d.
+ statistics.st_mode = F_file_mode_all_d | F_file_type_directory_d; // Should result in kt_remove_flag_operate_remove_d.
// Pre-process target.
will_return(__wrap_f_file_exists, F_true);
- will_return(__wrap_f_file_is, F_false); // Not a link, kt_remove_flag_file_operate_link_d is not set.
+ will_return(__wrap_f_file_is, F_false); // Not a link, kt_remove_flag_operate_link_d is not set.
will_return(__wrap_f_file_stat, &statistics);
will_return(__wrap_f_file_stat, F_okay);
const f_string_t argv[] = { "mocked_main", target.string, "-" KT_REMOVE_short_empty_s, KT_REMOVE_not_s, 0 };
memset(&statistics, 0, sizeof(struct stat));
- statistics.st_mode = F_file_mode_all_d | F_file_type_directory_d; // Should result in kt_remove_flag_file_operate_remove_d.
+ statistics.st_mode = F_file_mode_all_d | F_file_type_directory_d; // Should result in kt_remove_flag_operate_remove_d.
memset(&statistics_regular, 0, sizeof(struct stat));
- statistics_regular.st_mode = F_file_mode_all_d | F_file_type_regular_d; // Should result in kt_remove_flag_file_operate_remove_d.
+ statistics_regular.st_mode = F_file_mode_all_d | F_file_type_regular_d; // Should result in kt_remove_flag_operate_remove_d.
// Pre-process target.
will_return(__wrap_f_file_exists, F_true);
- will_return(__wrap_f_file_is, F_true); // A link, kt_remove_flag_file_operate_link_d is set.
+ will_return(__wrap_f_file_is, F_true); // A link, kt_remove_flag_operate_link_d is set.
will_return(__wrap_f_file_stat, &statistics);
will_return(__wrap_f_file_stat, F_okay);
// Directory processing.
- will_return(__wrap_f_directory_empty, F_false); // kt_remove_flag_file_operate_empty_d is set.
+ will_return(__wrap_f_directory_empty, F_false); // kt_remove_flag_operate_empty_d is set.
will_return(__wrap_fl_directory_do, 1);
will_return(__wrap_fl_directory_do, &target);
will_return(__wrap_fl_directory_do, &target);
// The pre-process gets called again before the final removal for directories.
will_return(__wrap_f_file_exists, F_true);
- will_return(__wrap_f_file_is, F_true); // A link, kt_remove_flag_file_operate_link_d is set.
+ will_return(__wrap_f_file_is, F_true); // A link, kt_remove_flag_operate_link_d is set.
will_return(__wrap_f_file_stat, &statistics);
will_return(__wrap_f_file_stat, F_okay);
will_return(__wrap_f_directory_empty, F_false);
- // @fixme when removal is attempted on non-empty directory due to empty not flag being set this likely should fail to remove on error that directory is not empty (recursive would need to be passed to succeed).
// This will fail if f_directory_remove() is not called, therefore success here means f_directory_remove has been called.
will_return(__wrap_f_directory_remove, F_okay);
const f_string_t argv[] = { "mocked_main", target.string, "+" F_console_standard_short_verbose_s, "-" KT_REMOVE_short_empty_s, KT_REMOVE_not_s, 0 };
memset(&statistics, 0, sizeof(struct stat));
- statistics.st_mode = F_file_mode_all_d | F_file_type_directory_d; // Should result in kt_remove_flag_file_operate_remove_d.
+ statistics.st_mode = F_file_mode_all_d | F_file_type_directory_d; // Should result in kt_remove_flag_operate_remove_d.
memset(&statistics_regular, 0, sizeof(struct stat));
- statistics_regular.st_mode = F_file_mode_all_d | F_file_type_regular_d; // Should result in kt_remove_flag_file_operate_remove_d.
+ statistics_regular.st_mode = F_file_mode_all_d | F_file_type_regular_d; // Should result in kt_remove_flag_operate_remove_d.
// Pre-process target.
will_return(__wrap_f_file_exists, F_true);
- will_return(__wrap_f_file_is, F_true); // A link, kt_remove_flag_file_operate_link_d is set.
+ will_return(__wrap_f_file_is, F_true); // A link, kt_remove_flag_operate_link_d is set.
will_return(__wrap_f_file_stat, &statistics);
will_return(__wrap_f_file_stat, F_okay);
// Directory processing.
- will_return(__wrap_f_directory_empty, F_false); // kt_remove_flag_file_operate_empty_d is set.
+ will_return(__wrap_f_directory_empty, F_false); // kt_remove_flag_operate_empty_d is set.
will_return(__wrap_fl_directory_do, 1);
will_return(__wrap_fl_directory_do, &target);
will_return(__wrap_fl_directory_do, &target);
// The pre-process gets called again before the final removal for directories.
will_return(__wrap_f_file_exists, F_true);
- will_return(__wrap_f_file_is, F_true); // A link, kt_remove_flag_file_operate_link_d is set.
+ will_return(__wrap_f_file_is, F_true); // A link, kt_remove_flag_operate_link_d is set.
will_return(__wrap_f_file_stat, &statistics);
will_return(__wrap_f_file_stat, F_okay);
will_return(__wrap_f_directory_empty, F_false);
const f_string_t argv[] = { "mocked_main", target.string, "+" F_console_standard_short_debug_s, "-" KT_REMOVE_short_empty_s, KT_REMOVE_not_s, 0 };
memset(&statistics, 0, sizeof(struct stat));
- statistics.st_mode = F_file_mode_all_d | F_file_type_directory_d; // Should result in kt_remove_flag_file_operate_remove_d.
+ statistics.st_mode = F_file_mode_all_d | F_file_type_directory_d; // Should result in kt_remove_flag_operate_remove_d.
memset(&statistics_regular, 0, sizeof(struct stat));
- statistics_regular.st_mode = F_file_mode_all_d | F_file_type_regular_d; // Should result in kt_remove_flag_file_operate_remove_d.
+ statistics_regular.st_mode = F_file_mode_all_d | F_file_type_regular_d; // Should result in kt_remove_flag_operate_remove_d.
// Pre-process target.
will_return(__wrap_f_file_exists, F_true);
- will_return(__wrap_f_file_is, F_true); // A link, kt_remove_flag_file_operate_link_d is set.
+ will_return(__wrap_f_file_is, F_true); // A link, kt_remove_flag_operate_link_d is set.
will_return(__wrap_f_file_stat, &statistics);
will_return(__wrap_f_file_stat, F_okay);
// Directory processing.
- will_return(__wrap_f_directory_empty, F_false); // kt_remove_flag_file_operate_empty_d is set.
+ will_return(__wrap_f_directory_empty, F_false); // kt_remove_flag_operate_empty_d is set.
will_return(__wrap_fl_directory_do, 1);
will_return(__wrap_fl_directory_do, &target);
will_return(__wrap_fl_directory_do, &target);
// The pre-process gets called again before the final removal for directories.
will_return(__wrap_f_file_exists, F_true);
- will_return(__wrap_f_file_is, F_true); // A link, kt_remove_flag_file_operate_link_d is set.
+ will_return(__wrap_f_file_is, F_true); // A link, kt_remove_flag_operate_link_d is set.
will_return(__wrap_f_file_stat, &statistics);
will_return(__wrap_f_file_stat, F_okay);
will_return(__wrap_f_directory_empty, F_false);
const f_string_t argv[] = { "mocked_main", target.string, "-" KT_REMOVE_short_empty_s, KT_REMOVE_not_s, 0 };
memset(&statistics, 0, sizeof(struct stat));
- statistics.st_mode = F_file_mode_all_d | F_file_type_directory_d; // Should result in kt_remove_flag_file_operate_remove_d.
+ statistics.st_mode = F_file_mode_all_d | F_file_type_directory_d; // Should result in kt_remove_flag_operate_remove_d.
memset(&statistics_regular, 0, sizeof(struct stat));
- statistics_regular.st_mode = F_file_mode_all_d | F_file_type_regular_d; // Should result in kt_remove_flag_file_operate_remove_d.
+ statistics_regular.st_mode = F_file_mode_all_d | F_file_type_regular_d; // Should result in kt_remove_flag_operate_remove_d.
// Pre-process target.
will_return(__wrap_f_file_exists, F_true);
- will_return(__wrap_f_file_is, F_false); // Not a link, kt_remove_flag_file_operate_link_d is not set.
+ will_return(__wrap_f_file_is, F_false); // Not a link, kt_remove_flag_operate_link_d is not set.
will_return(__wrap_f_file_stat, &statistics);
will_return(__wrap_f_file_stat, F_okay);
// Directory processing.
- will_return(__wrap_f_directory_empty, F_false); // kt_remove_flag_file_operate_empty_d is set.
+ will_return(__wrap_f_directory_empty, F_false); // kt_remove_flag_operate_empty_d is set.
will_return(__wrap_fl_directory_do, 2);
will_return(__wrap_fl_directory_do, &child);
will_return(__wrap_fl_directory_do, &child);
will_return(__wrap_fl_directory_do, f_directory_recurse_do_flag_action_d | f_directory_recurse_do_flag_regular_d);
will_return(__wrap_f_file_exists, F_true);
- will_return(__wrap_f_file_is, F_false); // Not a link, kt_remove_flag_file_operate_link_d is not set.
+ will_return(__wrap_f_file_is, F_false); // Not a link, kt_remove_flag_operate_link_d is not set.
will_return(__wrap_f_file_stat, &statistics_regular);
will_return(__wrap_f_file_stat, F_okay);
will_return(__wrap_f_file_remove, F_okay);
// The pre-process gets called again before the final removal for directories.
will_return(__wrap_f_file_exists, F_true);
- will_return(__wrap_f_file_is, F_true); // A link, kt_remove_flag_file_operate_link_d is set.
+ will_return(__wrap_f_file_is, F_true); // A link, kt_remove_flag_operate_link_d is set.
will_return(__wrap_f_file_stat, &statistics);
will_return(__wrap_f_file_stat, F_okay);
will_return(__wrap_f_directory_empty, F_false);
const f_string_t argv[] = { "mocked_main", target.string, "+" F_console_standard_short_verbose_s, "-" KT_REMOVE_short_empty_s, KT_REMOVE_not_s, 0 };
memset(&statistics, 0, sizeof(struct stat));
- statistics.st_mode = F_file_mode_all_d | F_file_type_directory_d; // Should result in kt_remove_flag_file_operate_remove_d.
+ statistics.st_mode = F_file_mode_all_d | F_file_type_directory_d; // Should result in kt_remove_flag_operate_remove_d.
memset(&statistics_regular, 0, sizeof(struct stat));
- statistics_regular.st_mode = F_file_mode_all_d | F_file_type_regular_d; // Should result in kt_remove_flag_file_operate_remove_d.
+ statistics_regular.st_mode = F_file_mode_all_d | F_file_type_regular_d; // Should result in kt_remove_flag_operate_remove_d.
// Pre-process target.
will_return(__wrap_f_file_exists, F_true);
- will_return(__wrap_f_file_is, F_false); // Not a link, kt_remove_flag_file_operate_link_d is not set.
+ will_return(__wrap_f_file_is, F_false); // Not a link, kt_remove_flag_operate_link_d is not set.
will_return(__wrap_f_file_stat, &statistics);
will_return(__wrap_f_file_stat, F_okay);
// Directory processing.
- will_return(__wrap_f_directory_empty, F_false); // kt_remove_flag_file_operate_empty_d is set.
+ will_return(__wrap_f_directory_empty, F_false); // kt_remove_flag_operate_empty_d is set.
will_return(__wrap_fl_directory_do, 2);
will_return(__wrap_fl_directory_do, &child);
will_return(__wrap_fl_directory_do, &child);
will_return(__wrap_fl_directory_do, f_directory_recurse_do_flag_action_d | f_directory_recurse_do_flag_regular_d);
will_return(__wrap_f_file_exists, F_true);
- will_return(__wrap_f_file_is, F_false); // Not a link, kt_remove_flag_file_operate_link_d is not set.
+ will_return(__wrap_f_file_is, F_false); // Not a link, kt_remove_flag_operate_link_d is not set.
will_return(__wrap_f_file_stat, &statistics_regular);
will_return(__wrap_f_file_stat, F_okay);
will_return(__wrap_f_file_remove, F_okay);
// The pre-process gets called again before the final removal for directories.
will_return(__wrap_f_file_exists, F_true);
- will_return(__wrap_f_file_is, F_true); // A link, kt_remove_flag_file_operate_link_d is set.
+ will_return(__wrap_f_file_is, F_true); // A link, kt_remove_flag_operate_link_d is set.
will_return(__wrap_f_file_stat, &statistics);
will_return(__wrap_f_file_stat, F_okay);
will_return(__wrap_f_directory_empty, F_false);
const f_string_t argv[] = { "mocked_main", target.string, "+" F_console_standard_short_debug_s, "-" KT_REMOVE_short_empty_s, KT_REMOVE_not_s, 0 };
memset(&statistics, 0, sizeof(struct stat));
- statistics.st_mode = F_file_mode_all_d | F_file_type_directory_d; // Should result in kt_remove_flag_file_operate_remove_d.
+ statistics.st_mode = F_file_mode_all_d | F_file_type_directory_d; // Should result in kt_remove_flag_operate_remove_d.
memset(&statistics_regular, 0, sizeof(struct stat));
- statistics_regular.st_mode = F_file_mode_all_d | F_file_type_regular_d; // Should result in kt_remove_flag_file_operate_remove_d.
+ statistics_regular.st_mode = F_file_mode_all_d | F_file_type_regular_d; // Should result in kt_remove_flag_operate_remove_d.
// Pre-process target.
will_return(__wrap_f_file_exists, F_true);
- will_return(__wrap_f_file_is, F_false); // Not a link, kt_remove_flag_file_operate_link_d is not set.
+ will_return(__wrap_f_file_is, F_false); // Not a link, kt_remove_flag_operate_link_d is not set.
will_return(__wrap_f_file_stat, &statistics);
will_return(__wrap_f_file_stat, F_okay);
// Directory processing.
- will_return(__wrap_f_directory_empty, F_false); // kt_remove_flag_file_operate_empty_d is set.
+ will_return(__wrap_f_directory_empty, F_false); // kt_remove_flag_operate_empty_d is set.
will_return(__wrap_fl_directory_do, 2);
will_return(__wrap_fl_directory_do, &child);
will_return(__wrap_fl_directory_do, &child);
will_return(__wrap_fl_directory_do, f_directory_recurse_do_flag_action_d | f_directory_recurse_do_flag_regular_d);
will_return(__wrap_f_file_exists, F_true);
- will_return(__wrap_f_file_is, F_false); // Not a link, kt_remove_flag_file_operate_link_d is not set.
+ will_return(__wrap_f_file_is, F_false); // Not a link, kt_remove_flag_operate_link_d is not set.
will_return(__wrap_f_file_stat, &statistics_regular);
will_return(__wrap_f_file_stat, F_okay);
will_return(__wrap_f_file_remove, F_okay);
// The pre-process gets called again before the final removal for directories.
will_return(__wrap_f_file_exists, F_true);
- will_return(__wrap_f_file_is, F_true); // A link, kt_remove_flag_file_operate_link_d is set.
+ will_return(__wrap_f_file_is, F_true); // A link, kt_remove_flag_operate_link_d is set.
will_return(__wrap_f_file_stat, &statistics);
will_return(__wrap_f_file_stat, F_okay);
will_return(__wrap_f_directory_empty, F_false);
const f_string_t argv[] = { "mocked_main", target.string, target_also.string, 0 };
memset(&statistics, 0, sizeof(struct stat));
- statistics.st_mode = F_file_mode_all_d | F_file_type_directory_d; // Should result in kt_remove_flag_file_operate_remove_d.
+ statistics.st_mode = F_file_mode_all_d | F_file_type_directory_d; // Should result in kt_remove_flag_operate_remove_d.
// Pre-process target 1.
will_return(__wrap_f_file_exists, F_false);
const f_string_t argv[] = { "mocked_main", target.string, target_also.string, "+" F_console_standard_short_verbose_s, 0 };
memset(&statistics, 0, sizeof(struct stat));
- statistics.st_mode = F_file_mode_all_d | F_file_type_directory_d; // Should result in kt_remove_flag_file_operate_remove_d.
+ statistics.st_mode = F_file_mode_all_d | F_file_type_directory_d; // Should result in kt_remove_flag_operate_remove_d.
// Pre-process target 1.
will_return(__wrap_f_file_exists, F_false);
const f_string_t argv[] = { "mocked_main", target.string, target_also.string, "+" F_console_standard_short_debug_s, 0 };
memset(&statistics, 0, sizeof(struct stat));
- statistics.st_mode = F_file_mode_all_d | F_file_type_directory_d; // Should result in kt_remove_flag_file_operate_remove_d.
+ statistics.st_mode = F_file_mode_all_d | F_file_type_directory_d; // Should result in kt_remove_flag_operate_remove_d.
// Pre-process target 1.
will_return(__wrap_f_file_exists, F_false);
const f_string_t argv[] = { "mocked_main", target.string, target_also.string, 0 };
memset(&statistics, 0, sizeof(struct stat));
- statistics.st_mode = F_file_mode_all_d | F_file_type_directory_d; // Should result in kt_remove_flag_file_operate_remove_d.
+ statistics.st_mode = F_file_mode_all_d | F_file_type_directory_d; // Should result in kt_remove_flag_operate_remove_d.
// Pre-process target 1.
will_return(__wrap_f_file_exists, F_true);
- will_return(__wrap_f_file_is, F_true); // A link, kt_remove_flag_file_operate_link_d is set.
+ will_return(__wrap_f_file_is, F_true); // A link, kt_remove_flag_operate_link_d is set.
will_return(__wrap_f_file_stat, &statistics);
will_return(__wrap_f_file_stat, F_okay);
// Pre-process target 2.
will_return(__wrap_f_file_exists, F_true);
- will_return(__wrap_f_file_is, F_true); // A link, kt_remove_flag_file_operate_link_d is set.
+ will_return(__wrap_f_file_is, F_true); // A link, kt_remove_flag_operate_link_d is set.
will_return(__wrap_f_file_stat, &statistics);
will_return(__wrap_f_file_stat, F_okay);
// Directory processing.
will_return(__wrap_f_directory_empty, F_true);
will_return(__wrap_fl_directory_do, 1);
- will_return(__wrap_fl_directory_do, &target);
- will_return(__wrap_fl_directory_do, &target);
+ will_return(__wrap_fl_directory_do, &target_also);
+ will_return(__wrap_fl_directory_do, &target_also);
will_return(__wrap_fl_directory_do, f_directory_recurse_do_flag_action_d | f_directory_recurse_do_flag_directory_d);
// The pre-process gets called again before the final removal for directories.
const f_string_t argv[] = { "mocked_main", target.string, target_also.string, "+" F_console_standard_short_verbose_s, 0 };
memset(&statistics, 0, sizeof(struct stat));
- statistics.st_mode = F_file_mode_all_d | F_file_type_directory_d; // Should result in kt_remove_flag_file_operate_remove_d.
+ statistics.st_mode = F_file_mode_all_d | F_file_type_directory_d; // Should result in kt_remove_flag_operate_remove_d.
// Pre-process target 1.
will_return(__wrap_f_file_exists, F_true);
- will_return(__wrap_f_file_is, F_true); // A link, kt_remove_flag_file_operate_link_d is set.
+ will_return(__wrap_f_file_is, F_true); // A link, kt_remove_flag_operate_link_d is set.
will_return(__wrap_f_file_stat, &statistics);
will_return(__wrap_f_file_stat, F_okay);
// Pre-process target 2.
will_return(__wrap_f_file_exists, F_true);
- will_return(__wrap_f_file_is, F_true); // A link, kt_remove_flag_file_operate_link_d is set.
+ will_return(__wrap_f_file_is, F_true); // A link, kt_remove_flag_operate_link_d is set.
will_return(__wrap_f_file_stat, &statistics);
will_return(__wrap_f_file_stat, F_okay);
// Directory processing.
will_return(__wrap_f_directory_empty, F_true);
will_return(__wrap_fl_directory_do, 1);
- will_return(__wrap_fl_directory_do, &target);
- will_return(__wrap_fl_directory_do, &target);
+ will_return(__wrap_fl_directory_do, &target_also);
+ will_return(__wrap_fl_directory_do, &target_also);
will_return(__wrap_fl_directory_do, f_directory_recurse_do_flag_action_d | f_directory_recurse_do_flag_directory_d);
// The pre-process gets called again before the final removal for directories.
const f_string_t argv[] = { "mocked_main", target.string, target_also.string, "+" F_console_standard_short_debug_s, 0 };
memset(&statistics, 0, sizeof(struct stat));
- statistics.st_mode = F_file_mode_all_d | F_file_type_directory_d; // Should result in kt_remove_flag_file_operate_remove_d.
+ statistics.st_mode = F_file_mode_all_d | F_file_type_directory_d; // Should result in kt_remove_flag_operate_remove_d.
// Pre-process target 1.
will_return(__wrap_f_file_exists, F_true);
- will_return(__wrap_f_file_is, F_true); // A link, kt_remove_flag_file_operate_link_d is set.
+ will_return(__wrap_f_file_is, F_true); // A link, kt_remove_flag_operate_link_d is set.
will_return(__wrap_f_file_stat, &statistics);
will_return(__wrap_f_file_stat, F_okay);
// Pre-process target 2.
will_return(__wrap_f_file_exists, F_true);
- will_return(__wrap_f_file_is, F_true); // A link, kt_remove_flag_file_operate_link_d is set.
+ will_return(__wrap_f_file_is, F_true); // A link, kt_remove_flag_operate_link_d is set.
will_return(__wrap_f_file_stat, &statistics);
will_return(__wrap_f_file_stat, F_okay);
// Directory processing.
will_return(__wrap_f_directory_empty, F_true);
will_return(__wrap_fl_directory_do, 1);
- will_return(__wrap_fl_directory_do, &target);
- will_return(__wrap_fl_directory_do, &target);
+ will_return(__wrap_fl_directory_do, &target_also);
+ will_return(__wrap_fl_directory_do, &target_also);
will_return(__wrap_fl_directory_do, f_directory_recurse_do_flag_action_d | f_directory_recurse_do_flag_directory_d);
// The pre-process gets called again before the final removal for directories.
const f_string_t argv[] = { "mocked_main", target.string, target_also.string, 0 };
memset(&statistics, 0, sizeof(struct stat));
- statistics.st_mode = F_file_mode_all_d | F_file_type_directory_d; // Should result in kt_remove_flag_file_operate_remove_d.
+ statistics.st_mode = F_file_mode_all_d | F_file_type_directory_d; // Should result in kt_remove_flag_operate_remove_d.
// Pre-process target 1.
will_return(__wrap_f_file_exists, F_true);
- will_return(__wrap_f_file_is, F_false); // Not a link, kt_remove_flag_file_operate_link_d is not set.
+ will_return(__wrap_f_file_is, F_false); // Not a link, kt_remove_flag_operate_link_d is not set.
will_return(__wrap_f_file_stat, &statistics);
will_return(__wrap_f_file_stat, F_okay);
// Pre-process target 2.
will_return(__wrap_f_file_exists, F_true);
- will_return(__wrap_f_file_is, F_true); // A link, kt_remove_flag_file_operate_link_d is set.
+ will_return(__wrap_f_file_is, F_true); // A link, kt_remove_flag_operate_link_d is set.
will_return(__wrap_f_file_stat, &statistics);
will_return(__wrap_f_file_stat, F_okay);
// Directory processing.
will_return(__wrap_f_directory_empty, F_true);
will_return(__wrap_fl_directory_do, 1);
- will_return(__wrap_fl_directory_do, &target);
- will_return(__wrap_fl_directory_do, &target);
+ will_return(__wrap_fl_directory_do, &target_also);
+ will_return(__wrap_fl_directory_do, &target_also);
will_return(__wrap_fl_directory_do, f_directory_recurse_do_flag_action_d | f_directory_recurse_do_flag_directory_d);
// The pre-process gets called again before the final removal for directories.
const f_string_t argv[] = { "mocked_main", target.string, target_also.string, "+" F_console_standard_short_verbose_s, 0 };
memset(&statistics, 0, sizeof(struct stat));
- statistics.st_mode = F_file_mode_all_d | F_file_type_directory_d; // Should result in kt_remove_flag_file_operate_remove_d.
+ statistics.st_mode = F_file_mode_all_d | F_file_type_directory_d; // Should result in kt_remove_flag_operate_remove_d.
// Pre-process target 1.
will_return(__wrap_f_file_exists, F_true);
- will_return(__wrap_f_file_is, F_false); // Not a link, kt_remove_flag_file_operate_link_d is not set.
+ will_return(__wrap_f_file_is, F_false); // Not a link, kt_remove_flag_operate_link_d is not set.
will_return(__wrap_f_file_stat, &statistics);
will_return(__wrap_f_file_stat, F_okay);
// Pre-process target 2.
will_return(__wrap_f_file_exists, F_true);
- will_return(__wrap_f_file_is, F_true); // A link, kt_remove_flag_file_operate_link_d is set.
+ will_return(__wrap_f_file_is, F_true); // A link, kt_remove_flag_operate_link_d is set.
will_return(__wrap_f_file_stat, &statistics);
will_return(__wrap_f_file_stat, F_okay);
// Directory processing.
will_return(__wrap_f_directory_empty, F_true);
will_return(__wrap_fl_directory_do, 1);
- will_return(__wrap_fl_directory_do, &target);
- will_return(__wrap_fl_directory_do, &target);
+ will_return(__wrap_fl_directory_do, &target_also);
+ will_return(__wrap_fl_directory_do, &target_also);
will_return(__wrap_fl_directory_do, f_directory_recurse_do_flag_action_d | f_directory_recurse_do_flag_directory_d);
// The pre-process gets called again before the final removal for directories.
const f_string_t argv[] = { "mocked_main", target.string, target_also.string, "+" F_console_standard_short_debug_s, 0 };
memset(&statistics, 0, sizeof(struct stat));
- statistics.st_mode = F_file_mode_all_d | F_file_type_directory_d; // Should result in kt_remove_flag_file_operate_remove_d.
+ statistics.st_mode = F_file_mode_all_d | F_file_type_directory_d; // Should result in kt_remove_flag_operate_remove_d.
// Pre-process target 1.
will_return(__wrap_f_file_exists, F_true);
- will_return(__wrap_f_file_is, F_false); // Not a link, kt_remove_flag_file_operate_link_d is not set.
+ will_return(__wrap_f_file_is, F_false); // Not a link, kt_remove_flag_operate_link_d is not set.
will_return(__wrap_f_file_stat, &statistics);
will_return(__wrap_f_file_stat, F_okay);
// Pre-process target 2.
will_return(__wrap_f_file_exists, F_true);
- will_return(__wrap_f_file_is, F_true); // A link, kt_remove_flag_file_operate_link_d is set.
+ will_return(__wrap_f_file_is, F_true); // A link, kt_remove_flag_operate_link_d is set.
will_return(__wrap_f_file_stat, &statistics);
will_return(__wrap_f_file_stat, F_okay);
// Directory processing.
will_return(__wrap_f_directory_empty, F_true);
will_return(__wrap_fl_directory_do, 1);
- will_return(__wrap_fl_directory_do, &target);
- will_return(__wrap_fl_directory_do, &target);
+ will_return(__wrap_fl_directory_do, &target_also);
+ will_return(__wrap_fl_directory_do, &target_also);
will_return(__wrap_fl_directory_do, f_directory_recurse_do_flag_action_d | f_directory_recurse_do_flag_directory_d);
// The pre-process gets called again before the final removal for directories.
// Pre-process file.
will_return(__wrap_f_file_exists, F_true);
- will_return(__wrap_f_file_is, F_true); // A link, kt_remove_flag_file_operate_link_d is set.
+ will_return(__wrap_f_file_is, F_true); // A link, kt_remove_flag_operate_link_d is set.
will_return(__wrap_f_file_stat, &stat_directory);
will_return(__wrap_f_file_stat, F_okay);
will_return(__wrap_fl_directory_do, &child_1);
will_return(__wrap_fl_directory_do, f_directory_recurse_do_flag_action_d | f_directory_recurse_do_flag_regular_d);
will_return(__wrap_f_file_exists, F_true);
- will_return(__wrap_f_file_is, F_false); // Not a link, kt_remove_flag_file_operate_link_d is not set.
+ will_return(__wrap_f_file_is, F_false); // Not a link, kt_remove_flag_operate_link_d is not set.
will_return(__wrap_f_file_stat, &stat_regular);
will_return(__wrap_f_file_stat, F_okay);
will_return(__wrap_f_file_remove, F_okay);
// Pre-process file.
will_return(__wrap_f_file_exists, F_true);
- will_return(__wrap_f_file_is, F_false); // Not a link, kt_remove_flag_file_operate_link_d is not set.
+ will_return(__wrap_f_file_is, F_false); // Not a link, kt_remove_flag_operate_link_d is not set.
will_return(__wrap_f_file_stat, &stat_directory);
will_return(__wrap_f_file_stat, F_okay);
will_return(__wrap_fl_directory_do, &child_1);
will_return(__wrap_fl_directory_do, f_directory_recurse_do_flag_action_d | f_directory_recurse_do_flag_regular_d);
will_return(__wrap_f_file_exists, F_true);
- will_return(__wrap_f_file_is, F_false); // Not a link, kt_remove_flag_file_operate_link_d is not set.
+ will_return(__wrap_f_file_is, F_false); // Not a link, kt_remove_flag_operate_link_d is not set.
will_return(__wrap_f_file_stat, &stat_regular);
will_return(__wrap_f_file_stat, F_okay);
will_return(__wrap_f_file_remove, F_okay);
// Pre-process file.
will_return(__wrap_f_file_exists, F_true);
- will_return(__wrap_f_file_is, F_true); // A link, kt_remove_flag_file_operate_link_d is set.
+ will_return(__wrap_f_file_is, F_true); // A link, kt_remove_flag_operate_link_d is set.
will_return(__wrap_f_file_stat, &stat_directory);
will_return(__wrap_f_file_stat, F_okay);
will_return(__wrap_fl_directory_do, &child_1);
will_return(__wrap_fl_directory_do, f_directory_recurse_do_flag_action_d | f_directory_recurse_do_flag_regular_d);
will_return(__wrap_f_file_exists, F_true);
- will_return(__wrap_f_file_is, F_false); // Not a link, kt_remove_flag_file_operate_link_d is not set.
+ will_return(__wrap_f_file_is, F_false); // Not a link, kt_remove_flag_operate_link_d is not set.
will_return(__wrap_f_file_stat, &stat_regular);
will_return(__wrap_f_file_stat, F_okay);
will_return(__wrap_f_file_remove, F_okay);
will_return(__wrap_fl_directory_do, &child_2);
will_return(__wrap_fl_directory_do, f_directory_recurse_do_flag_action_d | f_directory_recurse_do_flag_regular_d);
will_return(__wrap_f_file_exists, F_true);
- will_return(__wrap_f_file_is, F_true); // A link, kt_remove_flag_file_operate_link_d is set.
+ will_return(__wrap_f_file_is, F_true); // A link, kt_remove_flag_operate_link_d is set.
will_return(__wrap_f_file_stat, &stat_regular);
will_return(__wrap_f_file_stat, F_okay);
will_return(__wrap_f_file_remove, F_okay);
// Pre-process file.
will_return(__wrap_f_file_exists, F_true);
- will_return(__wrap_f_file_is, F_false); // Not a link, kt_remove_flag_file_operate_link_d is not set.
+ will_return(__wrap_f_file_is, F_false); // Not a link, kt_remove_flag_operate_link_d is not set.
will_return(__wrap_f_file_stat, &stat_directory);
will_return(__wrap_f_file_stat, F_okay);
will_return(__wrap_fl_directory_do, &child_1);
will_return(__wrap_fl_directory_do, f_directory_recurse_do_flag_action_d | f_directory_recurse_do_flag_regular_d);
will_return(__wrap_f_file_exists, F_true);
- will_return(__wrap_f_file_is, F_false); // Not a link, kt_remove_flag_file_operate_link_d is not set.
+ will_return(__wrap_f_file_is, F_false); // Not a link, kt_remove_flag_operate_link_d is not set.
will_return(__wrap_f_file_stat, &stat_regular);
will_return(__wrap_f_file_stat, F_okay);
will_return(__wrap_f_file_remove, F_okay);
will_return(__wrap_fl_directory_do, &child_2);
will_return(__wrap_fl_directory_do, f_directory_recurse_do_flag_action_d | f_directory_recurse_do_flag_regular_d);
will_return(__wrap_f_file_exists, F_true);
- will_return(__wrap_f_file_is, F_true); // A link, kt_remove_flag_file_operate_link_d is set.
+ will_return(__wrap_f_file_is, F_true); // A link, kt_remove_flag_operate_link_d is set.
will_return(__wrap_f_file_stat, &stat_regular);
will_return(__wrap_f_file_stat, F_okay);
will_return(__wrap_f_file_remove, F_okay);
// Pre-process file.
will_return(__wrap_f_file_exists, F_true);
- will_return(__wrap_f_file_is, F_true); // A link, kt_remove_flag_file_operate_link_d is set.
+ will_return(__wrap_f_file_is, F_true); // A link, kt_remove_flag_operate_link_d is set.
will_return(__wrap_f_file_stat, &stat_regular);
will_return(__wrap_f_file_stat, F_okay);
// Pre-process parent directory 1.
will_return(__wrap_f_file_exists, F_true);
- will_return(__wrap_f_file_is, F_false); // Not a link, kt_remove_flag_file_operate_link_d is not set.
+ will_return(__wrap_f_file_is, F_false); // Not a link, kt_remove_flag_operate_link_d is not set.
will_return(__wrap_f_file_stat, &stat_directory);
will_return(__wrap_f_file_stat, F_okay);
will_return(__wrap_f_directory_empty, F_true);
// Pre-process file.
will_return(__wrap_f_file_exists, F_true);
- will_return(__wrap_f_file_is, F_false); // Not a link, kt_remove_flag_file_operate_link_d is not set.
+ will_return(__wrap_f_file_is, F_false); // Not a link, kt_remove_flag_operate_link_d is not set.
will_return(__wrap_f_file_stat, &stat_regular);
will_return(__wrap_f_file_stat, F_okay);
// Pre-process parent directory 1.
will_return(__wrap_f_file_exists, F_true);
- will_return(__wrap_f_file_is, F_false); // Not a link, kt_remove_flag_file_operate_link_d is not set.
+ will_return(__wrap_f_file_is, F_false); // Not a link, kt_remove_flag_operate_link_d is not set.
will_return(__wrap_f_file_stat, &stat_directory);
will_return(__wrap_f_file_stat, F_okay);
will_return(__wrap_f_directory_empty, F_true);
// Pre-process file.
will_return(__wrap_f_file_exists, F_true);
- will_return(__wrap_f_file_is, F_true); // A link, kt_remove_flag_file_operate_link_d is set.
+ will_return(__wrap_f_file_is, F_true); // A link, kt_remove_flag_operate_link_d is set.
will_return(__wrap_f_file_stat, &stat_regular);
will_return(__wrap_f_file_stat, F_okay);
// Pre-process parent directory 1.
will_return(__wrap_f_file_exists, F_true);
- will_return(__wrap_f_file_is, F_false); // Not a link, kt_remove_flag_file_operate_link_d is not set.
+ will_return(__wrap_f_file_is, F_false); // Not a link, kt_remove_flag_operate_link_d is not set.
will_return(__wrap_f_file_stat, &stat_directory);
will_return(__wrap_f_file_stat, F_okay);
will_return(__wrap_f_directory_empty, F_true);
// Pre-process parent directory 2.
will_return(__wrap_f_file_exists, F_true);
- will_return(__wrap_f_file_is, F_false); // Not a link, kt_remove_flag_file_operate_link_d is not set.
+ will_return(__wrap_f_file_is, F_false); // Not a link, kt_remove_flag_operate_link_d is not set.
will_return(__wrap_f_file_stat, &stat_directory);
will_return(__wrap_f_file_stat, F_okay);
will_return(__wrap_f_directory_empty, F_true);
// Pre-process file.
will_return(__wrap_f_file_exists, F_true);
- will_return(__wrap_f_file_is, F_false); // Not a link, kt_remove_flag_file_operate_link_d is not set.
+ will_return(__wrap_f_file_is, F_false); // Not a link, kt_remove_flag_operate_link_d is not set.
will_return(__wrap_f_file_stat, &stat_regular);
will_return(__wrap_f_file_stat, F_okay);
// Pre-process parent directory 1.
will_return(__wrap_f_file_exists, F_true);
- will_return(__wrap_f_file_is, F_false); // Not a link, kt_remove_flag_file_operate_link_d is not set.
+ will_return(__wrap_f_file_is, F_false); // Not a link, kt_remove_flag_operate_link_d is not set.
will_return(__wrap_f_file_stat, &stat_directory);
will_return(__wrap_f_file_stat, F_okay);
will_return(__wrap_f_directory_empty, F_true);
// Pre-process parent directory 2.
will_return(__wrap_f_file_exists, F_true);
- will_return(__wrap_f_file_is, F_false); // Not a link, kt_remove_flag_file_operate_link_d is not set.
+ will_return(__wrap_f_file_is, F_false); // Not a link, kt_remove_flag_operate_link_d is not set.
will_return(__wrap_f_file_stat, &stat_directory);
will_return(__wrap_f_file_stat, F_okay);
will_return(__wrap_f_directory_empty, F_true);
if (macro_f_file_type_is_directory(stats[type].st_mode)) {
will_return(__wrap_f_directory_empty, F_true);
+
+ will_return(__wrap_fl_directory_do, 1);
+ will_return(__wrap_fl_directory_do, &target);
+ will_return(__wrap_fl_directory_do, &target);
+ will_return(__wrap_fl_directory_do, f_directory_recurse_do_flag_action_d | f_directory_recurse_do_flag_directory_d);
}
if (time_spec_removes[date]) {
if (macro_f_file_type_is_directory(stats[type].st_mode)) {
- will_return(__wrap_fl_directory_do, 1);
- will_return(__wrap_fl_directory_do, &target);
- will_return(__wrap_fl_directory_do, &target);
- will_return(__wrap_fl_directory_do, f_directory_recurse_do_flag_action_d | f_directory_recurse_do_flag_directory_d);
// The pre-process gets called again before the final removal for directories.
will_return(__wrap_f_file_exists, F_true);
if (macro_f_file_type_is_directory(stats[type].st_mode)) {
will_return(__wrap_f_directory_empty, F_true);
+
+ will_return(__wrap_fl_directory_do, 1);
+ will_return(__wrap_fl_directory_do, &target);
+ will_return(__wrap_fl_directory_do, &target);
+ will_return(__wrap_fl_directory_do, f_directory_recurse_do_flag_action_d | f_directory_recurse_do_flag_directory_d);
}
if (time_spec_removes[date]) {
if (macro_f_file_type_is_directory(stats[type].st_mode)) {
- will_return(__wrap_fl_directory_do, 1);
- will_return(__wrap_fl_directory_do, &target);
- will_return(__wrap_fl_directory_do, &target);
- will_return(__wrap_fl_directory_do, f_directory_recurse_do_flag_action_d | f_directory_recurse_do_flag_directory_d);
// The pre-process gets called again before the final removal for directories.
will_return(__wrap_f_file_exists, F_true);
if (macro_f_file_type_is_directory(stats[type].st_mode)) {
will_return(__wrap_f_directory_empty, F_true);
+
+ will_return(__wrap_fl_directory_do, 1);
+ will_return(__wrap_fl_directory_do, &target);
+ will_return(__wrap_fl_directory_do, &target);
+ will_return(__wrap_fl_directory_do, f_directory_recurse_do_flag_action_d | f_directory_recurse_do_flag_directory_d);
}
if (time_spec_removes[date]) {
if (macro_f_file_type_is_directory(stats[type].st_mode)) {
- will_return(__wrap_fl_directory_do, 1);
- will_return(__wrap_fl_directory_do, &target);
- will_return(__wrap_fl_directory_do, &target);
- will_return(__wrap_fl_directory_do, f_directory_recurse_do_flag_action_d | f_directory_recurse_do_flag_directory_d);
// The pre-process gets called again before the final removal for directories.
will_return(__wrap_f_file_exists, F_true);
will_return(__wrap_f_file_stat, &statistics);
will_return(__wrap_f_file_stat, F_okay);
+ if (macro_f_file_type_is_directory(statistics.st_mode)) {
+ will_return(__wrap_f_directory_empty, F_true);
+
+ will_return(__wrap_fl_directory_do, 1);
+ will_return(__wrap_fl_directory_do, &target);
+ will_return(__wrap_fl_directory_do, &target);
+ will_return(__wrap_fl_directory_do, f_directory_recurse_do_flag_action_d | f_directory_recurse_do_flag_directory_d);
+ }
+
// Process file.
if (param != mode) {
if (macro_f_file_type_is_directory(statistics.st_mode)) {
- will_return(__wrap_f_directory_empty, F_true);
- will_return(__wrap_fl_directory_do, 1);
- will_return(__wrap_fl_directory_do, &target);
- will_return(__wrap_fl_directory_do, &target);
- will_return(__wrap_fl_directory_do, f_directory_recurse_do_flag_action_d | f_directory_recurse_do_flag_directory_d);
// The pre-process gets called again before the final removal for directories.
will_return(__wrap_f_file_exists, F_true);
will_return(__wrap_f_file_remove, F_okay);
}
}
- else {
- if (macro_f_file_type_is_directory(statistics.st_mode)) {
- will_return(__wrap_f_directory_empty, F_true);
- }
- }
const int result = kt_main_test__remove(5, argv, 0);
will_return(__wrap_f_file_stat, &statistics);
will_return(__wrap_f_file_stat, F_okay);
+ if (macro_f_file_type_is_directory(statistics.st_mode)) {
+ will_return(__wrap_f_directory_empty, F_true);
+
+ will_return(__wrap_fl_directory_do, 1);
+ will_return(__wrap_fl_directory_do, &target);
+ will_return(__wrap_fl_directory_do, &target);
+ will_return(__wrap_fl_directory_do, f_directory_recurse_do_flag_action_d | f_directory_recurse_do_flag_directory_d);
+ }
+
// Process file.
if (param == mode) {
if (macro_f_file_type_is_directory(statistics.st_mode)) {
- will_return(__wrap_f_directory_empty, F_true);
- will_return(__wrap_fl_directory_do, 1);
- will_return(__wrap_fl_directory_do, &target);
- will_return(__wrap_fl_directory_do, &target);
- will_return(__wrap_fl_directory_do, f_directory_recurse_do_flag_action_d | f_directory_recurse_do_flag_directory_d);
// The pre-process gets called again before the final removal for directories.
will_return(__wrap_f_file_exists, F_true);
will_return(__wrap_f_file_remove, F_okay);
}
}
- else {
- if (macro_f_file_type_is_directory(statistics.st_mode)) {
- will_return(__wrap_f_directory_empty, F_true);
- }
- }
const int result = kt_main_test__remove(5, argv, 0);
will_return(__wrap_f_file_stat, &statistics);
will_return(__wrap_f_file_stat, F_okay);
+ if (macro_f_file_type_is_directory(statistics.st_mode)) {
+ will_return(__wrap_f_directory_empty, F_true);
+ will_return(__wrap_fl_directory_do, 1);
+ will_return(__wrap_fl_directory_do, &target);
+ will_return(__wrap_fl_directory_do, &target);
+ will_return(__wrap_fl_directory_do, f_directory_recurse_do_flag_action_d | f_directory_recurse_do_flag_directory_d);
+ }
+
// Process file.
if (modes[param] & modes[mode]) {
if (macro_f_file_type_is_directory(statistics.st_mode)) {
- will_return(__wrap_f_directory_empty, F_true);
- will_return(__wrap_fl_directory_do, 1);
- will_return(__wrap_fl_directory_do, &target);
- will_return(__wrap_fl_directory_do, &target);
- will_return(__wrap_fl_directory_do, f_directory_recurse_do_flag_action_d | f_directory_recurse_do_flag_directory_d);
// The pre-process gets called again before the final removal for directories.
will_return(__wrap_f_file_exists, F_true);
will_return(__wrap_f_file_remove, F_okay);
}
}
- else {
- if (macro_f_file_type_is_directory(statistics.st_mode)) {
- will_return(__wrap_f_directory_empty, F_true);
- }
- }
const int result = kt_main_test__remove(5, argv, 0);
will_return(__wrap_f_file_stat, &statistics);
will_return(__wrap_f_file_stat, F_okay);
+ if (macro_f_file_type_is_directory(statistics.st_mode)) {
+ will_return(__wrap_f_directory_empty, F_true);
+
+ will_return(__wrap_fl_directory_do, 1);
+ will_return(__wrap_fl_directory_do, &target);
+ will_return(__wrap_fl_directory_do, &target);
+ will_return(__wrap_fl_directory_do, f_directory_recurse_do_flag_action_d | f_directory_recurse_do_flag_directory_d);
+ }
+
// Process file.
if (modes[param] != modes[mode]) {
if (macro_f_file_type_is_directory(statistics.st_mode)) {
- will_return(__wrap_f_directory_empty, F_true);
- will_return(__wrap_fl_directory_do, 1);
- will_return(__wrap_fl_directory_do, &target);
- will_return(__wrap_fl_directory_do, &target);
- will_return(__wrap_fl_directory_do, f_directory_recurse_do_flag_action_d | f_directory_recurse_do_flag_directory_d);
// The pre-process gets called again before the final removal for directories.
will_return(__wrap_f_file_exists, F_true);
will_return(__wrap_f_file_remove, F_okay);
}
}
- else {
- if (macro_f_file_type_is_directory(statistics.st_mode)) {
- will_return(__wrap_f_directory_empty, F_true);
- }
- }
const int result = kt_main_test__remove(5, argv, 0);
will_return(__wrap_f_file_stat, &stats[i]);
will_return(__wrap_f_file_stat, F_okay);
+ if (macro_f_file_type_is_directory(stats[i].st_mode)) {
+ will_return(__wrap_f_directory_empty, F_true);
+
+ will_return(__wrap_fl_directory_do, 1);
+ will_return(__wrap_fl_directory_do, &target);
+ will_return(__wrap_fl_directory_do, &target);
+ will_return(__wrap_fl_directory_do, f_directory_recurse_do_flag_action_d | f_directory_recurse_do_flag_directory_d);
+ }
+
// Process file.
if (i == type) {
if (macro_f_file_type_is_directory(stats[i].st_mode)) {
- will_return(__wrap_f_directory_empty, F_true);
- will_return(__wrap_fl_directory_do, 1);
- will_return(__wrap_fl_directory_do, &target);
- will_return(__wrap_fl_directory_do, &target);
- will_return(__wrap_fl_directory_do, f_directory_recurse_do_flag_action_d | f_directory_recurse_do_flag_directory_d);
// The pre-process gets called again before the final removal for directories.
will_return(__wrap_f_file_exists, F_true);
- will_return(__wrap_f_file_is, macro_f_file_type_is_link(stats[type].st_mode));
- will_return(__wrap_f_file_stat, &stats[type]);
+ will_return(__wrap_f_file_is, macro_f_file_type_is_link(stats[i].st_mode));
+ will_return(__wrap_f_file_stat, &stats[i]);
will_return(__wrap_f_file_stat, F_okay);
will_return(__wrap_f_directory_empty, F_true);
// Pre-process file.
will_return(__wrap_f_file_exists, F_true);
- will_return(__wrap_f_file_is, F_false); // Not a link, kt_remove_flag_file_operate_link_d is not set.
+ will_return(__wrap_f_file_is, F_false); // Not a link, kt_remove_flag_operate_link_d is not set.
will_return(__wrap_f_file_stat, &stats[type]);
will_return(__wrap_f_file_stat, F_okay);
+ if (macro_f_file_type_is_directory(stats[type].st_mode)) {
+ will_return(__wrap_f_directory_empty, F_true);
+
+ will_return(__wrap_fl_directory_do, 1);
+ will_return(__wrap_fl_directory_do, &target);
+ will_return(__wrap_fl_directory_do, &target);
+ will_return(__wrap_fl_directory_do, f_directory_recurse_do_flag_action_d | f_directory_recurse_do_flag_directory_d);
+ }
+
// Process file.
if (stats[type].st_gid == group_id) {
if (macro_f_file_type_is_directory(stats[type].st_mode)) {
- will_return(__wrap_f_directory_empty, F_true);
- will_return(__wrap_fl_directory_do, 1);
- will_return(__wrap_fl_directory_do, &target);
- will_return(__wrap_fl_directory_do, &target);
- will_return(__wrap_fl_directory_do, f_directory_recurse_do_flag_action_d | f_directory_recurse_do_flag_directory_d);
// The pre-process gets called again before the final removal for directories.
will_return(__wrap_f_file_exists, F_true);
will_return(__wrap_f_file_remove, F_okay);
}
}
- else {
- if (macro_f_file_type_is_directory(stats[type].st_mode)) {
- will_return(__wrap_f_directory_empty, F_true);
- }
- }
const int result = kt_main_test__remove(4, argv, 0);
const f_string_t argv[] = { "mocked_main", "to_remove", 0 };
memset(&statistics, 0, sizeof(struct stat));
- statistics.st_mode = F_file_mode_all_d | F_file_type_regular_d; // Should result in kt_remove_flag_file_operate_remove_d.
+ statistics.st_mode = F_file_mode_all_d | F_file_type_regular_d; // Should result in kt_remove_flag_operate_remove_d.
// Pre-process file.
will_return(__wrap_f_file_exists, F_true);
- will_return(__wrap_f_file_is, F_true); // A link, kt_remove_flag_file_operate_link_d is set.
+ will_return(__wrap_f_file_is, F_true); // A link, kt_remove_flag_operate_link_d is set.
will_return(__wrap_f_file_stat, &statistics);
will_return(__wrap_f_file_stat, F_okay);
const f_string_t argv[] = { "mocked_main", "to_remove", "+" F_console_standard_short_verbose_s, 0 };
memset(&statistics, 0, sizeof(struct stat));
- statistics.st_mode = F_file_mode_all_d | F_file_type_regular_d; // Should result in kt_remove_flag_file_operate_remove_d.
+ statistics.st_mode = F_file_mode_all_d | F_file_type_regular_d; // Should result in kt_remove_flag_operate_remove_d.
// Pre-process file.
will_return(__wrap_f_file_exists, F_true);
- will_return(__wrap_f_file_is, F_true); // A link, kt_remove_flag_file_operate_link_d is set.
+ will_return(__wrap_f_file_is, F_true); // A link, kt_remove_flag_operate_link_d is set.
will_return(__wrap_f_file_stat, &statistics);
will_return(__wrap_f_file_stat, F_okay);
const f_string_t argv[] = { "mocked_main", "to_remove", "+" F_console_standard_short_debug_s, 0 };
memset(&statistics, 0, sizeof(struct stat));
- statistics.st_mode = F_file_mode_all_d | F_file_type_regular_d; // Should result in kt_remove_flag_file_operate_remove_d.
+ statistics.st_mode = F_file_mode_all_d | F_file_type_regular_d; // Should result in kt_remove_flag_operate_remove_d.
// Pre-process file.
will_return(__wrap_f_file_exists, F_true);
- will_return(__wrap_f_file_is, F_true); // A link, kt_remove_flag_file_operate_link_d is set.
+ will_return(__wrap_f_file_is, F_true); // A link, kt_remove_flag_operate_link_d is set.
will_return(__wrap_f_file_stat, &statistics);
will_return(__wrap_f_file_stat, F_okay);
const f_string_t argv[] = { "mocked_main", "to_remove", 0 };
memset(&statistics, 0, sizeof(struct stat));
- statistics.st_mode = F_file_mode_all_d | F_file_type_regular_d; // Should result in kt_remove_flag_file_operate_remove_d.
+ statistics.st_mode = F_file_mode_all_d | F_file_type_regular_d; // Should result in kt_remove_flag_operate_remove_d.
// Pre-process file.
will_return(__wrap_f_file_exists, F_true);
- will_return(__wrap_f_file_is, F_false); // Not a link, kt_remove_flag_file_operate_link_d is not set.
+ will_return(__wrap_f_file_is, F_false); // Not a link, kt_remove_flag_operate_link_d is not set.
will_return(__wrap_f_file_stat, &statistics);
will_return(__wrap_f_file_stat, F_okay);
const f_string_t argv[] = { "mocked_main", "to_remove", "+" F_console_standard_short_verbose_s, 0 };
memset(&statistics, 0, sizeof(struct stat));
- statistics.st_mode = F_file_mode_all_d | F_file_type_regular_d; // Should result in kt_remove_flag_file_operate_remove_d.
+ statistics.st_mode = F_file_mode_all_d | F_file_type_regular_d; // Should result in kt_remove_flag_operate_remove_d.
// Pre-process file.
will_return(__wrap_f_file_exists, F_true);
- will_return(__wrap_f_file_is, F_false); // Not a link, kt_remove_flag_file_operate_link_d is not set.
+ will_return(__wrap_f_file_is, F_false); // Not a link, kt_remove_flag_operate_link_d is not set.
will_return(__wrap_f_file_stat, &statistics);
will_return(__wrap_f_file_stat, F_okay);
const f_string_t argv[] = { "mocked_main", "to_remove", "+" F_console_standard_short_debug_s, 0 };
memset(&statistics, 0, sizeof(struct stat));
- statistics.st_mode = F_file_mode_all_d | F_file_type_regular_d; // Should result in kt_remove_flag_file_operate_remove_d.
+ statistics.st_mode = F_file_mode_all_d | F_file_type_regular_d; // Should result in kt_remove_flag_operate_remove_d.
// Pre-process file.
will_return(__wrap_f_file_exists, F_true);
- will_return(__wrap_f_file_is, F_false); // Not a link, kt_remove_flag_file_operate_link_d is not set.
+ will_return(__wrap_f_file_is, F_false); // Not a link, kt_remove_flag_operate_link_d is not set.
will_return(__wrap_f_file_stat, &statistics);
will_return(__wrap_f_file_stat, F_okay);
const f_string_t argv[] = { "mocked_main", "to_remove", "also/remove", 0 };
memset(&statistics, 0, sizeof(struct stat));
- statistics.st_mode = F_file_mode_all_d | F_file_type_regular_d; // Should result in kt_remove_flag_file_operate_remove_d.
+ statistics.st_mode = F_file_mode_all_d | F_file_type_regular_d; // Should result in kt_remove_flag_operate_remove_d.
// Pre-process file 1.
will_return(__wrap_f_file_exists, F_false);
const f_string_t argv[] = { "mocked_main", "to_remove", "also/remove", "+" F_console_standard_short_verbose_s, 0 };
memset(&statistics, 0, sizeof(struct stat));
- statistics.st_mode = F_file_mode_all_d | F_file_type_regular_d; // Should result in kt_remove_flag_file_operate_remove_d.
+ statistics.st_mode = F_file_mode_all_d | F_file_type_regular_d; // Should result in kt_remove_flag_operate_remove_d.
// Pre-process file 1.
will_return(__wrap_f_file_exists, F_false);
const f_string_t argv[] = { "mocked_main", "to_remove", "also/remove", "+" F_console_standard_short_debug_s, 0 };
memset(&statistics, 0, sizeof(struct stat));
- statistics.st_mode = F_file_mode_all_d | F_file_type_regular_d; // Should result in kt_remove_flag_file_operate_remove_d.
+ statistics.st_mode = F_file_mode_all_d | F_file_type_regular_d; // Should result in kt_remove_flag_operate_remove_d.
// Pre-process file 1.
will_return(__wrap_f_file_exists, F_false);
const f_string_t argv[] = { "mocked_main", "to_remove", "also/remove", 0 };
memset(&statistics, 0, sizeof(struct stat));
- statistics.st_mode = F_file_mode_all_d | F_file_type_regular_d; // Should result in kt_remove_flag_file_operate_remove_d.
+ statistics.st_mode = F_file_mode_all_d | F_file_type_regular_d; // Should result in kt_remove_flag_operate_remove_d.
// Pre-process file 1.
will_return(__wrap_f_file_exists, F_true);
- will_return(__wrap_f_file_is, F_true); // A link, kt_remove_flag_file_operate_link_d is set.
+ will_return(__wrap_f_file_is, F_true); // A link, kt_remove_flag_operate_link_d is set.
will_return(__wrap_f_file_stat, &statistics);
will_return(__wrap_f_file_stat, F_okay);
// Pre-process file 2.
will_return(__wrap_f_file_exists, F_true);
- will_return(__wrap_f_file_is, F_true); // A link, kt_remove_flag_file_operate_link_d is set.
+ will_return(__wrap_f_file_is, F_true); // A link, kt_remove_flag_operate_link_d is set.
will_return(__wrap_f_file_stat, &statistics);
will_return(__wrap_f_file_stat, F_okay);
const f_string_t argv[] = { "mocked_main", "to_remove", "also/remove", "+" F_console_standard_short_verbose_s, 0 };
memset(&statistics, 0, sizeof(struct stat));
- statistics.st_mode = F_file_mode_all_d | F_file_type_regular_d; // Should result in kt_remove_flag_file_operate_remove_d.
+ statistics.st_mode = F_file_mode_all_d | F_file_type_regular_d; // Should result in kt_remove_flag_operate_remove_d.
// Pre-process file 1.
will_return(__wrap_f_file_exists, F_true);
- will_return(__wrap_f_file_is, F_true); // A link, kt_remove_flag_file_operate_link_d is set.
+ will_return(__wrap_f_file_is, F_true); // A link, kt_remove_flag_operate_link_d is set.
will_return(__wrap_f_file_stat, &statistics);
will_return(__wrap_f_file_stat, F_okay);
// Pre-process file 2.
will_return(__wrap_f_file_exists, F_true);
- will_return(__wrap_f_file_is, F_true); // A link, kt_remove_flag_file_operate_link_d is set.
+ will_return(__wrap_f_file_is, F_true); // A link, kt_remove_flag_operate_link_d is set.
will_return(__wrap_f_file_stat, &statistics);
will_return(__wrap_f_file_stat, F_okay);
const f_string_t argv[] = { "mocked_main", "to_remove", "also/remove", "+" F_console_standard_short_debug_s, 0 };
memset(&statistics, 0, sizeof(struct stat));
- statistics.st_mode = F_file_mode_all_d | F_file_type_regular_d; // Should result in kt_remove_flag_file_operate_remove_d.
+ statistics.st_mode = F_file_mode_all_d | F_file_type_regular_d; // Should result in kt_remove_flag_operate_remove_d.
// Pre-process file 1.
will_return(__wrap_f_file_exists, F_true);
- will_return(__wrap_f_file_is, F_true); // A link, kt_remove_flag_file_operate_link_d is set.
+ will_return(__wrap_f_file_is, F_true); // A link, kt_remove_flag_operate_link_d is set.
will_return(__wrap_f_file_stat, &statistics);
will_return(__wrap_f_file_stat, F_okay);
// Pre-process file 2.
will_return(__wrap_f_file_exists, F_true);
- will_return(__wrap_f_file_is, F_true); // A link, kt_remove_flag_file_operate_link_d is set.
+ will_return(__wrap_f_file_is, F_true); // A link, kt_remove_flag_operate_link_d is set.
will_return(__wrap_f_file_stat, &statistics);
will_return(__wrap_f_file_stat, F_okay);
const f_string_t argv[] = { "mocked_main", "to_remove", "also/remove", 0 };
memset(&statistics, 0, sizeof(struct stat));
- statistics.st_mode = F_file_mode_all_d | F_file_type_regular_d; // Should result in kt_remove_flag_file_operate_remove_d.
+ statistics.st_mode = F_file_mode_all_d | F_file_type_regular_d; // Should result in kt_remove_flag_operate_remove_d.
// Pre-process file 1.
will_return(__wrap_f_file_exists, F_true);
- will_return(__wrap_f_file_is, F_false); // Not a link, kt_remove_flag_file_operate_link_d is not set.
+ will_return(__wrap_f_file_is, F_false); // Not a link, kt_remove_flag_operate_link_d is not set.
will_return(__wrap_f_file_stat, &statistics);
will_return(__wrap_f_file_stat, F_okay);
// Pre-process file 2.
will_return(__wrap_f_file_exists, F_true);
- will_return(__wrap_f_file_is, F_false); // Not a link, kt_remove_flag_file_operate_link_d is not set.
+ will_return(__wrap_f_file_is, F_false); // Not a link, kt_remove_flag_operate_link_d is not set.
will_return(__wrap_f_file_stat, &statistics);
will_return(__wrap_f_file_stat, F_okay);
const f_string_t argv[] = { "mocked_main", "to_remove", "also/remove", "+" F_console_standard_short_verbose_s, 0 };
memset(&statistics, 0, sizeof(struct stat));
- statistics.st_mode = F_file_mode_all_d | F_file_type_regular_d; // Should result in kt_remove_flag_file_operate_remove_d.
+ statistics.st_mode = F_file_mode_all_d | F_file_type_regular_d; // Should result in kt_remove_flag_operate_remove_d.
// Pre-process file 1.
will_return(__wrap_f_file_exists, F_true);
- will_return(__wrap_f_file_is, F_false); // Not a link, kt_remove_flag_file_operate_link_d is not set.
+ will_return(__wrap_f_file_is, F_false); // Not a link, kt_remove_flag_operate_link_d is not set.
will_return(__wrap_f_file_stat, &statistics);
will_return(__wrap_f_file_stat, F_okay);
// Pre-process file 2.
will_return(__wrap_f_file_exists, F_true);
- will_return(__wrap_f_file_is, F_false); // Not a link, kt_remove_flag_file_operate_link_d is not set.
+ will_return(__wrap_f_file_is, F_false); // Not a link, kt_remove_flag_operate_link_d is not set.
will_return(__wrap_f_file_stat, &statistics);
will_return(__wrap_f_file_stat, F_okay);
const f_string_t argv[] = { "mocked_main", "to_remove", "also/remove", "+" F_console_standard_short_debug_s, 0 };
memset(&statistics, 0, sizeof(struct stat));
- statistics.st_mode = F_file_mode_all_d | F_file_type_regular_d; // Should result in kt_remove_flag_file_operate_remove_d.
+ statistics.st_mode = F_file_mode_all_d | F_file_type_regular_d; // Should result in kt_remove_flag_operate_remove_d.
// Pre-process file 1.
will_return(__wrap_f_file_exists, F_true);
- will_return(__wrap_f_file_is, F_false); // Not a link, kt_remove_flag_file_operate_link_d is not set.
+ will_return(__wrap_f_file_is, F_false); // Not a link, kt_remove_flag_operate_link_d is not set.
will_return(__wrap_f_file_stat, &statistics);
will_return(__wrap_f_file_stat, F_okay);
// Pre-process file 2.
will_return(__wrap_f_file_exists, F_true);
- will_return(__wrap_f_file_is, F_false); // Not a link, kt_remove_flag_file_operate_link_d is not set.
+ will_return(__wrap_f_file_is, F_false); // Not a link, kt_remove_flag_operate_link_d is not set.
will_return(__wrap_f_file_stat, &statistics);
will_return(__wrap_f_file_stat, F_okay);
if (macro_f_file_type_is_directory(stats[type].st_mode)) {
will_return(__wrap_f_directory_empty, F_true);
+
+ will_return(__wrap_fl_directory_do, 1);
+ will_return(__wrap_fl_directory_do, &target);
+ will_return(__wrap_fl_directory_do, &target);
+ will_return(__wrap_fl_directory_do, f_directory_recurse_do_flag_action_d | f_directory_recurse_do_flag_directory_d);
}
if (time_spec_removes[date]) {
if (macro_f_file_type_is_directory(stats[type].st_mode)) {
- will_return(__wrap_fl_directory_do, 1);
- will_return(__wrap_fl_directory_do, &target);
- will_return(__wrap_fl_directory_do, &target);
- will_return(__wrap_fl_directory_do, f_directory_recurse_do_flag_action_d | f_directory_recurse_do_flag_directory_d);
// The pre-process gets called again before the final removal for directories.
will_return(__wrap_f_file_exists, F_true);
if (macro_f_file_type_is_directory(stats[type].st_mode)) {
will_return(__wrap_f_directory_empty, F_true);
+
+ will_return(__wrap_fl_directory_do, 1);
+ will_return(__wrap_fl_directory_do, &target);
+ will_return(__wrap_fl_directory_do, &target);
+ will_return(__wrap_fl_directory_do, f_directory_recurse_do_flag_action_d | f_directory_recurse_do_flag_directory_d);
}
if (time_spec_removes[date]) {
if (macro_f_file_type_is_directory(stats[type].st_mode)) {
- will_return(__wrap_fl_directory_do, 1);
- will_return(__wrap_fl_directory_do, &target);
- will_return(__wrap_fl_directory_do, &target);
- will_return(__wrap_fl_directory_do, f_directory_recurse_do_flag_action_d | f_directory_recurse_do_flag_directory_d);
// The pre-process gets called again before the final removal for directories.
will_return(__wrap_f_file_exists, F_true);
if (macro_f_file_type_is_directory(stats[type].st_mode)) {
will_return(__wrap_f_directory_empty, F_true);
+
+ will_return(__wrap_fl_directory_do, 1);
+ will_return(__wrap_fl_directory_do, &target);
+ will_return(__wrap_fl_directory_do, &target);
+ will_return(__wrap_fl_directory_do, f_directory_recurse_do_flag_action_d | f_directory_recurse_do_flag_directory_d);
}
if (time_spec_removes[date]) {
if (macro_f_file_type_is_directory(stats[type].st_mode)) {
- will_return(__wrap_fl_directory_do, 1);
- will_return(__wrap_fl_directory_do, &target);
- will_return(__wrap_fl_directory_do, &target);
- will_return(__wrap_fl_directory_do, f_directory_recurse_do_flag_action_d | f_directory_recurse_do_flag_directory_d);
// The pre-process gets called again before the final removal for directories.
will_return(__wrap_f_file_exists, F_true);
if (macro_f_file_type_is_directory(stats[type].st_mode)) {
will_return(__wrap_f_directory_empty, F_true);
+
+ will_return(__wrap_fl_directory_do, 1);
+ will_return(__wrap_fl_directory_do, &target);
+ will_return(__wrap_fl_directory_do, &target);
+ will_return(__wrap_fl_directory_do, f_directory_recurse_do_flag_action_d | f_directory_recurse_do_flag_directory_d);
}
if (time_spec_removes[date]) {
if (macro_f_file_type_is_directory(stats[type].st_mode)) {
- will_return(__wrap_fl_directory_do, 1);
- will_return(__wrap_fl_directory_do, &target);
- will_return(__wrap_fl_directory_do, &target);
- will_return(__wrap_fl_directory_do, f_directory_recurse_do_flag_action_d | f_directory_recurse_do_flag_directory_d);
// The pre-process gets called again before the final removal for directories.
will_return(__wrap_f_file_exists, F_true);
if (macro_f_file_type_is_directory(stats[type].st_mode)) {
will_return(__wrap_f_directory_empty, F_true);
+
+ will_return(__wrap_fl_directory_do, 1);
+ will_return(__wrap_fl_directory_do, &target);
+ will_return(__wrap_fl_directory_do, &target);
+ will_return(__wrap_fl_directory_do, f_directory_recurse_do_flag_action_d | f_directory_recurse_do_flag_directory_d);
}
if (time_spec_removes[date]) {
if (macro_f_file_type_is_directory(stats[type].st_mode)) {
- will_return(__wrap_fl_directory_do, 1);
- will_return(__wrap_fl_directory_do, &target);
- will_return(__wrap_fl_directory_do, &target);
- will_return(__wrap_fl_directory_do, f_directory_recurse_do_flag_action_d | f_directory_recurse_do_flag_directory_d);
// The pre-process gets called again before the final removal for directories.
will_return(__wrap_f_file_exists, F_true);
if (macro_f_file_type_is_directory(stats[type].st_mode)) {
will_return(__wrap_f_directory_empty, F_true);
+
+ will_return(__wrap_fl_directory_do, 1);
+ will_return(__wrap_fl_directory_do, &target);
+ will_return(__wrap_fl_directory_do, &target);
+ will_return(__wrap_fl_directory_do, f_directory_recurse_do_flag_action_d | f_directory_recurse_do_flag_directory_d);
}
if (time_spec_removes[date]) {
if (macro_f_file_type_is_directory(stats[type].st_mode)) {
- will_return(__wrap_fl_directory_do, 1);
- will_return(__wrap_fl_directory_do, &target);
- will_return(__wrap_fl_directory_do, &target);
- will_return(__wrap_fl_directory_do, f_directory_recurse_do_flag_action_d | f_directory_recurse_do_flag_directory_d);
// The pre-process gets called again before the final removal for directories.
will_return(__wrap_f_file_exists, F_true);
// Pre-process file.
will_return(__wrap_f_file_exists, F_true);
- will_return(__wrap_f_file_is, F_false); // Not a link, kt_remove_flag_file_operate_link_d is not set.
+ will_return(__wrap_f_file_is, F_false); // Not a link, kt_remove_flag_operate_link_d is not set.
will_return(__wrap_f_file_stat, &stats[type]);
will_return(__wrap_f_file_stat, F_okay);
- // Process file.
- if (stats[type].st_uid == user_id) {
- if (macro_f_file_type_is_directory(stats[type].st_mode)) {
- will_return(__wrap_f_directory_empty, F_true);
- }
+ if (macro_f_file_type_is_directory(stats[type].st_mode)) {
+ will_return(__wrap_f_directory_empty, F_true);
+ will_return(__wrap_fl_directory_do, 1);
+ will_return(__wrap_fl_directory_do, &target);
+ will_return(__wrap_fl_directory_do, &target);
+ will_return(__wrap_fl_directory_do, f_directory_recurse_do_flag_action_d | f_directory_recurse_do_flag_directory_d);
}
- else {
+
+ // Process file.
+ if (stats[type].st_uid != user_id) {
if (macro_f_file_type_is_directory(stats[type].st_mode)) {
- will_return(__wrap_f_directory_empty, F_true);
- will_return(__wrap_fl_directory_do, 1);
- will_return(__wrap_fl_directory_do, &target);
- will_return(__wrap_fl_directory_do, &target);
- will_return(__wrap_fl_directory_do, f_directory_recurse_do_flag_action_d | f_directory_recurse_do_flag_directory_d);
// The pre-process gets called again before the final removal for directories.
will_return(__wrap_geteuid, user_id);
// Pre-process file.
will_return(__wrap_f_file_exists, F_true);
- will_return(__wrap_f_file_is, F_false); // Not a link, kt_remove_flag_file_operate_link_d is not set.
+ will_return(__wrap_f_file_is, F_false); // Not a link, kt_remove_flag_operate_link_d is not set.
will_return(__wrap_f_file_stat, &stats[type]);
will_return(__wrap_f_file_stat, F_okay);
+ if (macro_f_file_type_is_directory(stats[type].st_mode)) {
+ will_return(__wrap_f_directory_empty, F_true);
+ will_return(__wrap_fl_directory_do, 1);
+ will_return(__wrap_fl_directory_do, &target);
+ will_return(__wrap_fl_directory_do, &target);
+ will_return(__wrap_fl_directory_do, f_directory_recurse_do_flag_action_d | f_directory_recurse_do_flag_directory_d);
+ }
+
// Process file.
if (stats[type].st_uid == user_id) {
if (macro_f_file_type_is_directory(stats[type].st_mode)) {
- will_return(__wrap_f_directory_empty, F_true);
- will_return(__wrap_fl_directory_do, 1);
- will_return(__wrap_fl_directory_do, &target);
- will_return(__wrap_fl_directory_do, &target);
- will_return(__wrap_fl_directory_do, f_directory_recurse_do_flag_action_d | f_directory_recurse_do_flag_directory_d);
// The pre-process gets called again before the final removal for directories.
will_return(__wrap_f_file_exists, F_true);
will_return(__wrap_f_file_remove, F_okay);
}
}
- else {
- if (macro_f_file_type_is_directory(stats[type].st_mode)) {
- will_return(__wrap_f_directory_empty, F_true);
- }
- }
const int result = kt_main_test__remove(4, argv, 0);
// Pre-process file.
will_return(__wrap_f_file_exists, F_true);
- will_return(__wrap_f_file_is, F_false); // Not a link, kt_remove_flag_file_operate_link_d is not set.
+ will_return(__wrap_f_file_is, F_false); // Not a link, kt_remove_flag_operate_link_d is not set.
will_return(__wrap_f_file_stat, &stats[type]);
will_return(__wrap_f_file_stat, F_okay);
+ if (macro_f_file_type_is_directory(stats[type].st_mode)) {
+ will_return(__wrap_f_directory_empty, F_true);
+ will_return(__wrap_fl_directory_do, 1);
+ will_return(__wrap_fl_directory_do, &target);
+ will_return(__wrap_fl_directory_do, &target);
+ will_return(__wrap_fl_directory_do, f_directory_recurse_do_flag_action_d | f_directory_recurse_do_flag_directory_d);
+ }
+
// Process file.
if (stats[type].st_uid == user_id) {
if (macro_f_file_type_is_directory(stats[type].st_mode)) {
- will_return(__wrap_f_directory_empty, F_true);
- will_return(__wrap_fl_directory_do, 1);
- will_return(__wrap_fl_directory_do, &target);
- will_return(__wrap_fl_directory_do, &target);
- will_return(__wrap_fl_directory_do, f_directory_recurse_do_flag_action_d | f_directory_recurse_do_flag_directory_d);
// The pre-process gets called again before the final removal for directories.
will_return(__wrap_geteuid, user_id);
will_return(__wrap_f_file_remove, F_okay);
}
}
- else {
- if (macro_f_file_type_is_directory(stats[type].st_mode)) {
- will_return(__wrap_f_directory_empty, F_true);
- }
- }
const int result = kt_main_test__remove(3, argv, 0);