]> Kevux Git Server - kevux-tools/log
kevux-tools
2 months agoUpdate: Add FLL socket defines disable.
Kevin Day [Sun, 14 Dec 2025 23:49:23 +0000 (17:49 -0600)]
Update: Add FLL socket defines disable.

2 months agoUpdate: Bring in build settings changes from FLL.
Kevin Day [Sat, 13 Dec 2025 17:53:56 +0000 (11:53 -0600)]
Update: Bring in build settings changes from FLL.

2 months agoUpdate: Make build settings more consistent across multiple projects.
Kevin Day [Sat, 13 Dec 2025 05:19:11 +0000 (23:19 -0600)]
Update: Make build settings more consistent across multiple projects.

3 months agoRefactor: Build mode gcc_13 to flex_arrays to provide a more generic name.
Kevin Day [Wed, 10 Dec 2025 04:25:33 +0000 (22:25 -0600)]
Refactor: Build mode gcc_13 to flex_arrays to provide a more generic name.

The `gcc_13` was a temporary mode and I don't want to have version specific modes.
Replace the mode witha more long term version unspecific name `flex_arrays`.

3 months agoUpdate: Main program structures to follow consistent styling across several projects.
Kevin Day [Sat, 6 Dec 2025 05:07:31 +0000 (23:07 -0600)]
Update: Main program structures to follow consistent styling across several projects.

3 months agoCleanup: Switch from 'callback' to 'call'.
Kevin Day [Sat, 6 Dec 2025 04:53:11 +0000 (22:53 -0600)]
Cleanup: Switch from 'callback' to 'call'.

3 months agoCleanup: Remove build settings objects that specify the default values.
Kevin Day [Sat, 6 Dec 2025 02:56:20 +0000 (20:56 -0600)]
Cleanup: Remove build settings objects that specify the default values.

3 months agoUpdate: FLL date and time changes.
Kevin Day [Thu, 4 Dec 2025 05:47:00 +0000 (23:47 -0600)]
Update: FLL date and time changes.

3 months agoUpdate: Initialize variables with recent FLL practices.
Kevin Day [Wed, 3 Dec 2025 04:19:29 +0000 (22:19 -0600)]
Update: Initialize variables with recent FLL practices.

3 months agoUpdate: Use the macro_*__t_initialize_3() for static data.
Kevin Day [Wed, 3 Dec 2025 04:01:17 +0000 (22:01 -0600)]
Update: Use the macro_*__t_initialize_3() for static data.

3 months agoUpdate: Initialize variables with recent FLL practices.
Kevin Day [Wed, 3 Dec 2025 03:42:37 +0000 (21:42 -0600)]
Update: Initialize variables with recent FLL practices.

3 months agoUpdate: To FLL structure changes.
Kevin Day [Mon, 1 Dec 2025 00:23:31 +0000 (18:23 -0600)]
Update: To FLL structure changes.

Apply similar practices to the structures.

3 months agoUpdate: To FLL f_string_static_t structure changes.
Kevin Day [Sun, 30 Nov 2025 14:07:40 +0000 (08:07 -0600)]
Update: To FLL f_string_static_t structure changes.

3 months agoCleanup: The stand alone fakefile comments should use 0.8.x to represent the FLL...
Kevin Day [Sun, 30 Nov 2025 02:37:35 +0000 (20:37 -0600)]
Cleanup: The stand alone fakefile comments should use 0.8.x to represent the FLL dependency.

3 months agoUpdate: Provide a way to use different file names for both send and receive as well...
Kevin Day [Sun, 30 Nov 2025 01:53:51 +0000 (19:53 -0600)]
Update: Provide a way to use different file names for both send and receive as well as other changes.

Utilize the set flag for defining the state on whether or not to keep the senders file name when receiving.
Utilize the set flag for defining whether or not the send is a send set or a receive set.

Provide a `-a` or `--as` parameter for a sender to declare a custom name for some file being transferred.

Do not pre-check or pre-write to files when the file name will only be known once a packet is received.

The direction string no longer needs to be passed to functions now that the set flag defines what direction it is.

Consistently add new lines at the start of the message printing.

Do not reset the set flag on initialization (resetting).
Rename the initialization functions to use the word "reset" to avoid confusion with the real initialization process.

Print verbose log message declaring the name of the received file when keeping the senders file name and when headers are not printed.

Fix mistake where the `kt_tacocat_socket_step_receive_find_e` is incorrectly being compared against the set flag rather than the set step.

Fix problems preventing stand alone builds from compiling.

3 months agoCleanup: Use initializer for f_time_spec_t.
Kevin Day [Fri, 28 Nov 2025 05:00:26 +0000 (23:00 -0600)]
Cleanup: Use initializer for f_time_spec_t.

3 months agoUpdate: Latest FLL now returns F_file_descriptor_not.
Kevin Day [Thu, 27 Nov 2025 14:28:39 +0000 (08:28 -0600)]
Update: Latest FLL now returns F_file_descriptor_not.

3 months agoUpdate: Ensure F_okay is assigned at success on done for receive step.
Kevin Day [Wed, 26 Nov 2025 06:21:50 +0000 (00:21 -0600)]
Update: Ensure F_okay is assigned at success on done for receive step.

3 months agoUpdate: Error printing functions.
Kevin Day [Wed, 26 Nov 2025 04:23:59 +0000 (22:23 -0600)]
Update: Error printing functions.

Use `debug` instead of `function`.

Ensure that the status code printed has the error bit removed.

3 months agoUpdate: Use the set to manage dynamic varriables associated with the receive abstruses.
Kevin Day [Wed, 26 Nov 2025 04:00:57 +0000 (22:00 -0600)]
Update: Use the set to manage dynamic varriables associated with the receive abstruses.

Avod de-allocation issues when an abstruse type gets swapped around by only using dynamic strings already managed by another structure, like the set struccture.
Ensure these never get auto de-allocation by setting size to 0.

Handle each receive abstruse headers and ensure they get printed.

Provide a separate status variable to allow for detecting all header problems without failing until the very end of the function.

3 months agoUpdate: Add support for printing headers on send or receive and other changes.
Kevin Day [Tue, 25 Nov 2025 05:51:00 +0000 (23:51 -0600)]
Update: Add support for printing headers on send or receive and other changes.

Store the numeric port on the set.

The received headers are not being fully printed yet.

Make sure file close warnings are printed on file close failure when receiving.

3 months agoCleanup: Remove extra line from the help print out.
Kevin Day [Tue, 25 Nov 2025 03:38:18 +0000 (21:38 -0600)]
Cleanup: Remove extra line from the help print out.

3 months agoUpdate: Break apart TacocaT receive steps into multiple functions.
Kevin Day [Tue, 25 Nov 2025 02:59:38 +0000 (20:59 -0600)]
Update: Break apart TacocaT receive steps into multiple functions.

This adds a lot more files but cleans up the code quite a bit.
The `kt_tacocat_receive_process()` function is now easier to read and follow.

Update the send steps.

3 months agoUpdate: Break apart TacocaT send steps into multiple functions.
Kevin Day [Mon, 24 Nov 2025 04:35:42 +0000 (22:35 -0600)]
Update: Break apart TacocaT send steps into multiple functions.

This adds a lot more files but cleans up the code quite a bit.
The `kt_tacocat_send_process()` function is now easier to read and follow.

I anticipate doing similar things to other parts of TacocaT.

3 months agoUpdate: Unblock FLL functions for generating time during stand alone builds.
Kevin Day [Mon, 24 Nov 2025 04:35:00 +0000 (22:35 -0600)]
Update: Unblock FLL functions for generating time during stand alone builds.

3 months agoUpdate: Switch to the FLL functions for generating time.
Kevin Day [Mon, 24 Nov 2025 02:28:38 +0000 (20:28 -0600)]
Update: Switch to the FLL functions for generating time.

The time Object now properly appears in the packet.

3 months agoUpdate: Next micro version (0.7.4).
Kevin Day [Sat, 22 Nov 2025 22:51:50 +0000 (16:51 -0600)]
Update: Next micro version (0.7.4).

The following are the commands that I ran to make this change:
  # find data/ sources/ specifications/ documents/ licenses/ install.sh -type f -exec sed -i -e 's|0\.7\.3|0.7.4|g' -e 's|^version_micro 3|version_micro 4|g' '{}' ';'
  # find sources/ -name *.h -exec sed -i -e 's|_program_version_micro_s F_string_ascii_3_s|_program_version_micro_s F_string_ascii_4_s|g' -e 's|_program_version_micro_s_length F_string_ascii_3_s_length|_program_version_micro_s_length F_string_ascii_4_s_length|g' '{}' ';'
  # sed -i -e 's|version_micro 3|version_micro 4|g' data/build/{remove,tacocat}/settings data/build/stand_alone/settings/settings.*

3 months agoUpdate: Utilize the F_status_debug_source_d for handling the errors. 0.7.3
Kevin Day [Wed, 12 Nov 2025 05:16:07 +0000 (23:16 -0600)]
Update: Utilize the F_status_debug_source_d for handling the errors.

This simplifies some of the logic and code.

However, there are some disadvantages of doing this.
One such disadvantage is losing the specific function that has failed.
The location in the source file should be sufficient, if not ideal.

4 months agowUpdate: Minimal changes to compile with the error printing changes in FLL.
Kevin Day [Tue, 11 Nov 2025 03:22:32 +0000 (21:22 -0600)]
wUpdate: Minimal changes to compile with the error printing changes in FLL.

There will likely be a follow up commit to handle the details.

Also remove stale build setting file so that the stand alone build works.

4 months agoUpdate: Prepare for supporting the status debug define.
Kevin Day [Sun, 9 Nov 2025 04:35:09 +0000 (22:35 -0600)]
Update: Prepare for supporting the status debug define.

The `F_status_debug_source_d` should now be supported with this change.
This is not yet used.

Update the build settings modes.

6 months agoUpdate: FLL f_thread changes.
Kevin Day [Thu, 28 Aug 2025 03:07:42 +0000 (22:07 -0500)]
Update: FLL f_thread changes.

6 months agoUpdate: Add specific source design documentation.
Kevin Day [Wed, 27 Aug 2025 02:40:12 +0000 (21:40 -0500)]
Update: Add specific source design documentation.

I have described this in one manner or another since the start of the FLL project.
This explicitly states the behavior that the FLL project (and related projects) have always followed.

6 months agoUpdate: Synchronize with f_thread changes from FLL project.
Kevin Day [Wed, 20 Aug 2025 03:55:28 +0000 (22:55 -0500)]
Update: Synchronize with f_thread changes from FLL project.

6 months agoUpdate: With latest define settings.
Kevin Day [Mon, 18 Aug 2025 04:26:29 +0000 (23:26 -0500)]
Update: With latest define settings.

6 months agoUpdate: With latest FLL changes.
Kevin Day [Wed, 13 Aug 2025 02:36:38 +0000 (21:36 -0500)]
Update: With latest FLL changes.

7 months agoCleanup: Remove no longer used _di_f_status_directory_s_.
Kevin Day [Tue, 12 Aug 2025 02:49:24 +0000 (21:49 -0500)]
Cleanup: Remove no longer used _di_f_status_directory_s_.

7 months agoBugfix: Duplicate error messages and problems with errors when --force is passed.
Kevin Day [Sun, 20 Jul 2025 22:24:47 +0000 (17:24 -0500)]
Bugfix: Duplicate error messages and problems with errors when --force is passed.

Do not print duplicate error messages.
Duplicate error messages happen for directories.
The directory recursion handles errors so the caller should not need to.
This is not the case for top-level non-directories.

The `--force` parameter should prevent certain error messages from being printed.
The `--force` should also not result in an error being returned for these types of errors.

8 months agoUpdate: Next micro version (0.7.3).
Kevin Day [Sun, 6 Jul 2025 21:02:51 +0000 (16:02 -0500)]
Update: Next micro version (0.7.3).

The following are the commands that I ran to make this change:
  # find data/ sources/ specifications/ documents/ licenses/ install.sh -type f -exec sed -i -e 's|0\.7\.2|0.7.3|g' -e 's|^version_micro 2|version_micro 3|g' '{}' ';'
  # find sources/ -name *.h -exec sed -i -e 's|_program_version_micro_s F_string_ascii_2_s|_program_version_micro_s F_string_ascii_3_s|g' -e 's|_program_version_micro_s_length F_string_ascii_2_s_length|_program_version_micro_s_length F_string_ascii_3_s_length|g' '{}' ';'
  # sed -i -e 's|version_micro 2|version_micro 3|g' data/build/{remove,tacocat}/settings data/build/stand_alone/settings/settings.*

8 months agoBugfix: Enable required file defines in the stand alone remove build. 0.7.2
Kevin Day [Tue, 1 Jul 2025 03:11:52 +0000 (22:11 -0500)]
Bugfix: Enable required file defines in the stand alone remove build.

8 months agoCleanup: Remove todo that I will not get to.
Kevin Day [Tue, 1 Jul 2025 03:01:55 +0000 (22:01 -0500)]
Cleanup: Remove todo that I will not get to.

8 months agoCleanup: Use F_file_at_current_working_d.
Kevin Day [Tue, 1 Jul 2025 03:01:23 +0000 (22:01 -0500)]
Cleanup: Use F_file_at_current_working_d.

The `AT_CWD` is already defined as `F_file_at_current_working_d`.

8 months agoCleanup: Documentation comments for program signal handlers.
Kevin Day [Tue, 1 Jul 2025 02:50:51 +0000 (21:50 -0500)]
Cleanup: Documentation comments for program signal handlers.

The function references and "must not be NULL" messages are missing.

8 months agoCleanup: Apply new script practices.
Kevin Day [Sat, 28 Jun 2025 03:41:08 +0000 (22:41 -0500)]
Cleanup: Apply new script practices.

Be more consistent about wrapping all variables in brackets.
This helps make the code more consistent and also more compatible with other interpreters like ZSH.

Don't use echo pipe syntax and instead use "<<<" redirection pipe syntax for passing variables to program calls.

The grep commands should use either `-sho` or `-shoP`.

8 months agoBugfix: File not found errors with f_file_access().
Kevin Day [Tue, 17 Jun 2025 03:48:44 +0000 (22:48 -0500)]
Bugfix: File not found errors with f_file_access().

This is happening because the symbolic link is being followed.
Avoid this behavior by switching to using f_file_access_at().
Set the directory to the current working directory, which happens to be `-100`.

I need to revisit this once I decided on how I am going to handle the CWD of `-100` for the FLL library as a whole.

Ignore file not found errors on access checks.
If the file does not exist, then do not care if the access check for a non-existent file fails.

8 months agoBugfix: Incorrect status code reporting on f_file_access() error.
Kevin Day [Tue, 17 Jun 2025 03:31:48 +0000 (22:31 -0500)]
Bugfix: Incorrect status code reporting on f_file_access() error.

The wrong status variable is being used.
Switch to the function that accepts status as a parameter.

8 months agoBugfix: Handle deleting on access denied errors.
Kevin Day [Sun, 15 Jun 2025 16:02:14 +0000 (11:02 -0500)]
Bugfix: Handle deleting on access denied errors.

Detect the read, write, and execute permissions.
Print the unable to read, write, and execute status for each path when in simulate mode.

Add additional strings as needed.
Address an alphabet ordering mistake in the strings.

The preprocess now happens outside of the process function.
This better allows for calling the preprocess in the "before" state of the recursion and the process happens during the "action" state of the recursion.
This also allows for completely avoiding a second preprocess call for depth 0 recursive paths.

The operate flag is now handled on a per depth basis.
This requires a new array of flags for each depth.

The `normal` part of `kt_remove_flag_recurse_*_d` now use the work `active` instead of `normal`.
This makes reading and understanding the code easier given the more direct meaning of the word.

With the preprocess logic now outside of the process logic, the `top` and `parent` recurse states from `kt_remove_flag_recurse_*_d` no longer need to be part of the preprocess.
They are not used anywhere else so remove them.

Make the code simpler by just using an `uint64_t` rather than an `uint32_t` for the operate flag.
This also avoids the need for casting when adding it to the recurse code value.

Update the `remove-config.h`.
I noticed that the sorting is working differently from system to system.
I had to manually adjust/correct some of the ordering and I may have missed some things.
I will need to figure out the cause of the inconsistency at some point.

Fix the linking to make sure the fl_path library is included.
Also make sure the static library link paths are used in the tests as well.

A new flag `return_fail` main flag is added to designate that the final state should be a failure.
This is done because a single file remove failure on file does not exist should not prevent other failures.
(The classic `rm` command will remove all files that it can and return an error for any error.)

The unit tests are updated.
The unit tests are updated to respect the 32-bit to 64-bit type change.
The unit tests now handles the `f_file_access()` calls.
The unit tests now handles the updated directory recursion and pre-process flow.
The `recurse.depth` must now be mocked.

I would further note that at some point in time in the future, I need to not mock `fl_directory_do()` and instead call that directly and mocks its calls.
This is a complex situation that would require mocking the directory list and several other things.
This is too much work to do at this time.

The updated unit tests exposed a concern regarding immediately exiting the pre-process after an "is file type" check.
Move this down to the end of the pre-process to allow for other checks to happen.
I have some concerns with doing this for additional behavior and I will need to review and test other programs.
(That is, the `rmdir` vs `rm` vs `unlink` behavior are directly tied to "is file type" checks.)
I'd rather not make this commit any larger than it already is and so I am leaving the further investigation and changes to another time.

9 months agoSecurity: Explicitly define IFS to prevent misuse.
Kevin Day [Fri, 6 Jun 2025 02:45:25 +0000 (21:45 -0500)]
Security: Explicitly define IFS to prevent misuse.

The scripts are written with certain expectations.
This expectation may not be properly met if the `IFS` value is changed.
This can potentially be used to create some sort of exploit.

Explicitly define IFS and then do so at a local variable scope to prevent affecting the callers IFS setting.

9 months agoUpdate: Use explicitly declared parameters and ensure -v/--verbose are both printed.
Kevin Day [Fri, 6 Jun 2025 01:24:42 +0000 (20:24 -0500)]
Update: Use explicitly declared parameters and ensure -v/--verbose are both printed.

Printing help for `rmdir` should result in printing both the `-v` and `--verbose` options.

Explicitly declare the `version` and `verbose` strings due to the custom nature of them for the `rm` and `rmdir` programs.

9 months agoCleanup: Remove stale commented out code.
Kevin Day [Tue, 3 Jun 2025 01:42:38 +0000 (20:42 -0500)]
Cleanup: Remove stale commented out code.

10 months agoWorkaround: The compiler and linker fail to understand that compiling statically...
Kevin Day [Thu, 8 May 2025 04:53:19 +0000 (23:53 -0500)]
Workaround: The compiler and linker fail to understand that compiling statically should also link statically.

This is a logic or design flaw that is just plain idiotic.
When compiling statically (passing `-static`), there cannot be any shared/dynamic linked data.

Rather than recognizing this, if there is a shared library during a static build then the shared library is linked to.

The compiler and linker, at least, supports explicitly forcing the point that a static library is to be linked.
This is done via `-l:libc.a` for libc linking rather than `-lc`.

This should not be necessary, but it unfortunately is.

10 months agoCleanup: Remove some todos that I won't get to.
Kevin Day [Fri, 2 May 2025 01:09:26 +0000 (20:09 -0500)]
Cleanup: Remove some todos that I won't get to.

These are some nice to have todos but I will not get around to them given my shift in priorities and time.

10 months agoUpdate: Some macros and documentation.
Kevin Day [Thu, 1 May 2025 02:50:28 +0000 (21:50 -0500)]
Update: Some macros and documentation.

I am starting to get back to working on TacocaT.
This addresses a single `@todo` regarding adding documentation and also renames several of the related macros.

10 months agoUpdate: Add missing parameters to the remove documentation.
Kevin Day [Thu, 1 May 2025 02:32:08 +0000 (21:32 -0500)]
Update: Add missing parameters to the remove documentation.

10 months agoCleanup: Improve wording in help printing.
Kevin Day [Thu, 1 May 2025 02:31:42 +0000 (21:31 -0500)]
Cleanup: Improve wording in help printing.

10 months agoUpdate: Next micro version (0.7.2).
Kevin Day [Thu, 1 May 2025 01:50:51 +0000 (20:50 -0500)]
Update: Next micro version (0.7.2).

The following are the commands that I ran to make this change.
  # find data/ sources/ specifications/ documents/ licenses/ install.sh -type f -exec sed -i -e 's|0\.7\.1|0.7.2|g' '{}' ';'
  # find data/ sources/ specifications/ documents/ licenses/ -type f -exec sed -i -e 's|^version_micro 1|version_micro 2|g' '{}' ';'
  # find sources/ -name *.h -exec sed -i -e 's|_program_version_micro_s F_string_ascii_1_s|_program_version_micro_s F_string_ascii_2_s|g' '{}' ';'
  # find sources/ -name *.h -exec sed -i -e 's|_program_version_micro_s_length F_string_ascii_1_s_length|_program_version_micro_s_length F_string_ascii_2_s_length|g' '{}' ';'
  # sed -i -e 's|version_micro 1|version_micro 2|g' data/build/{remove,tacocat}/settings data/build/stand_alone/settings/settings.*

10 months agoUpdate: Set error state on kt_remove_flag_operate_remove_fail_d and toggle directory... 0.7.1
Kevin Day [Sun, 27 Apr 2025 23:33:59 +0000 (18:33 -0500)]
Update: Set error state on kt_remove_flag_operate_remove_fail_d and toggle directory empty behavior.

An error should be returned when the `kt_remove_flag_operate_remove_fail_d` is passed.
This should only happen when not simulating.

The directory empty behavior should utilize the flag `kt_remove_flag_operate_empty_d` to avoid checking the state value.

10 months agoUpdate: The fl_directory_do() now explicitly requires flags to be set.
Kevin Day [Sun, 27 Apr 2025 22:30:07 +0000 (17:30 -0500)]
Update: The fl_directory_do() now explicitly requires flags to be set.

The action flag used to be always processed but this is no longer the case.

10 months agoCleanup: Remove 'main_' prefix from fakefile operations to simplify usage.
Kevin Day [Sun, 27 Apr 2025 22:29:51 +0000 (17:29 -0500)]
Cleanup: Remove 'main_' prefix from fakefile operations to simplify usage.

10 months agoProgress: Continue working on completing the remove program.
Kevin Day [Fri, 25 Apr 2025 04:23:55 +0000 (23:23 -0500)]
Progress: Continue working on completing the remove program.

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.

10 months agoUpdate: Add higher level testfile.
Kevin Day [Wed, 23 Apr 2025 03:45:50 +0000 (22:45 -0500)]
Update: Add higher level testfile.

Previously, something like the following is needed to perform the "remove" program runtime unit tests:
```
fake -w /tmp/fll-0.7/ clean make -f testfile -U build/remove
```

This new `testfile` allows for shortening the command to:
```
fake -w /tmp/fll-0.7/ clean make -f testfile
```

Note tat the `-w /tmp/fll-0.7/` is an example use-case for where I am storing the work directory files.
The command can be simplified to just the following (given a clean source directory and proper system installation of dependencies):
```
fake -f testfile
```

10 months agoProgress: Continue working on completing the remove program.
Kevin Day [Wed, 23 Apr 2025 02:47:54 +0000 (21:47 -0500)]
Progress: Continue working on completing the remove program.

Remove no longer used flags and code.

Add recurse flags.

The statistics cache ended up not being used.
Remove it entirely and the related code adding to the cache.

The tree mode is now updated to be in line with the latest functionality..

Ensure that the simulate is not printed twice for the top level directory being recursed.
This is done by adding an additional "simulate not" flag that is then passed to simulate printing functions as appropriate.
This is only needed for cases where the recursion is enabled.

10 months agoProgress: Continue working on completing the remove program.
Kevin Day [Mon, 21 Apr 2025 03:18:08 +0000 (22:18 -0500)]
Progress: Continue working on completing the remove program.

Update to the latest FLL changes.
The FLL changes include parameter processing changes to support the `--` parameter as a stop processing parameters option.
Enable this and remove the manual process that was previously performed.

Add the root path check.
Make sure a parameter exists in the `remove` program to toggle this behavior.

A lot of the simulate and directory recursion behavior is now dead code due to the recent recursion changes.
Remove the dead code and simplify the parameters.

Update the unit tests.
I noticed some situations in the unit tests that could be improved to be more accurate and correct.
An `@fixme` has been added to accomplish this.

10 months agoBugfix: Properly report exists check.
Kevin Day [Sat, 19 Apr 2025 03:06:32 +0000 (22:06 -0500)]
Bugfix: Properly report exists check.

The status is being changed.
Use a new variable to preserve the exists status and pass that to the exists check function.

10 months agoProgress: Continue working on completing the remove program.
Kevin Day [Sat, 19 Apr 2025 02:22:26 +0000 (21:22 -0500)]
Progress: Continue working on completing the remove program.

Remove final remove command in directory recursion.
It turns out that there is a bug in FLL `fl_directory_do()` that makes this necessary.
That bug is now fixed and this code is no longer needed.
In fact, with `fl_directory_do()` fixed this now causes a problem with attempt to double delete a directory.

10 months agoProgress: Continue working on completing the remove program.
Kevin Day [Thu, 17 Apr 2025 03:33:49 +0000 (22:33 -0500)]
Progress: Continue working on completing the remove program.

Update in regards to recent FLL directory changes.

10 months agoUpdate: Pass 0 to f_directory_remove() to avoid nftw() calls.
Kevin Day [Sun, 13 Apr 2025 19:53:27 +0000 (14:53 -0500)]
Update: Pass 0 to f_directory_remove() to avoid nftw() calls.

The `fl_directory_do()` already is taking care of the recursive delete.
The `f_directory_remove()` should not need to recurse.

The `nftw()` uses a lot of resources and slows down the speed even when the directory is empty.

The massif-visualizer shows that with `nftw()` there are two ~548.8 Kb spikes to remove empty directories.
Without the `nftw()` there is only a single 64Kb spike to remove the same empty directories.

The time taken with `nftw()` takes about 4e+06.
The time taken without `nftw()` takes about 1.6e+06.

The memory usage according to valgrind with `nftw()` is about 84 allocs, 84 frees, 3,303,959 bytes allocated.
The memory usage according to valgrind without `nftw()` is about 74 allocs, 74 frees, 497,999 bytes allocated.

The command I used to test this is:
```
clear ; md a/b/{c/d,e/f} && touch xxx && touch a/b/file.txt && valgrind remove a/b xxx -r ; t a
clear ; md a/b/{c/d,e/f} && touch xxx && touch a/b/file.txt && valgrind --tool=massif remove a/b xxx -r ; t a
```

11 months agoProgress: Continue working on completing the remove program.
Kevin Day [Sun, 13 Apr 2025 03:12:51 +0000 (22:12 -0500)]
Progress: Continue working on completing the remove program.

Add normal allocation length define and shrink the path to this size if the size is larger than the large length.

Restructure the simulate to be called during the directory recursion so that there is only a single `fl_directory_do()` recursion.
The simulate must not be aware of when it is being called during recursion and when it is not being called during recursion.
The directory has to be processed to determine if and when it is being recursed.
However, the directory should be deleted after recursion into its child paths.
Update the unit rests accordingly.

The directory recursion is now moved into a top level cache.
This reduces the amount of allocations necessary and makes clean up on exit easier.

The parent path logic needs to be updated.
I added sample snippet of code with a todo, commented out.

Remove some stale documentation comments.

I did some basic tests using (with and without `-S` added):
```
clear ; md a/b/c/d && touch a/b/file.txt && valgrind --leak-check=full remove +V a/b -r ; t a
```

And (with and without `-S` added):
```
clear ; md a/b/{c/d,e/f} && touch a/b/file.txt && valgrind --leak-check=full remove +V a/b -r ; t a
```

The file statistics for the top-level directory being recursed needs to be preserved and passed through to the simulate.
The first directory processing pass before recursion should retain this.
During recursion, the parent directory should utilize this information when needed.

11 months agoProgress: Continue working on completing the remove program.
Kevin Day [Fri, 11 Apr 2025 03:55:39 +0000 (22:55 -0500)]
Progress: Continue working on completing the remove program.

Add file type ignore flags to conditionally suppress printing types when not wanted during simulation.
This is needed for the `rm` program when simulate is wrong.
Prior to this change the `rm` program is showing all file types.

11 months agoProgress: Continue working on completing the remove program.
Kevin Day [Thu, 10 Apr 2025 02:48:01 +0000 (21:48 -0500)]
Progress: Continue working on completing the remove program.

I want to remove the multiple `fl_directory_do()` calls.
This means that I need to change how pre-processing and removal is performed.
The pre-processing needs to happen before each remove.
The recursion needs to happen during the remove.

This begins refactoring the code to allow for this design change.
The recursive functions do not use the `main.setting.state.status` and so the functions need to be updated to instead return the status.
I placed a delete on the top level, but recursion is not necessarily properly done yet.
I only partially changed the structure to test out some of the recent changes, primarily trying to confirm/deny if the simulate is working as desired.
I still need to complete/correct the logic for proper deletion with recursion.

Update to utilize the newly added `fll_program_signal_check_loop()` and `fll_program_signal_check_simple()`.

Remove all stale and no longer needed signal check defines.

11 months agoFeature: Update to utilize fll_program_signal_check_loop() and fll_program_signal_che...
Kevin Day [Thu, 10 Apr 2025 02:32:06 +0000 (21:32 -0500)]
Feature: Update to utilize fll_program_signal_check_loop() and fll_program_signal_check_simple().

Update to utilize the newly added `fll_program_signal_check_loop()` and `fll_program_signal_check_simple()`.

Remove all stale and no longer needed signal check defines.

11 months agoProgress: Continue working on completing the remove program.
Kevin Day [Thu, 3 Apr 2025 03:28:22 +0000 (22:28 -0500)]
Progress: Continue working on completing the remove program.

Make sure to not set the `kt_remove_main_flag_option_type_d` for the "different" and "same" parameters.
Make sure to not set the `kt_remove_main_flag_option_used_d` for the "empty" parameters.

The `kt_remove_flag_file_operate_recurse_d` flag is being set on a directory, but it is always being set without regard to te recursive parameter.
Remove it an and just check the recurse parameter instead.

The empty not flag should be checked when checking empty states.

Remove accidental assignment of `kt_remove_flag_file_operate_remove_d` when `is` is true for the `kt_remove_preprocess_file_type()`.

Address the program unit tests.
Add the empty parameters in places where the tests were originally expecting the remove command to remove non-empty directories by default.

The directory tree tests were improperly returning false on the mocked empty for the parent directory after the child directory was mock deleted.

I'm currently investigating problems where the following does not work as expect:
```shell
clear ; md a/b/c ; touch a/b/file ; remove a/b/ -r +V ; t a
```

Cast the `flag_operate` when transfering to/from the `recurse.state.code`.

11 months agoProgress: Continue working on completing the remove program.
Kevin Day [Wed, 2 Apr 2025 04:24:47 +0000 (23:24 -0500)]
Progress: Continue working on completing the remove program.

Remove redundant code and get rid of a lot of the callbacks.
I did further structural investigation and found that I really didn't need most callbacks.

Add special flags to distinguish when file types are being specified and when they are not.
Then when this is set, handle accordingly and print errors.
This reduces the need for custom handling code in each of the other programs like `rm`, `rmdir`, and `unlink`.

Update the settings and flags accordingly.

I have not gotten the time to update the unit tests, which currently now fail.
I also need to review the programs and their replacement counterparts for any problems.

11 months agoProgress: Continue working on completing the remove program.
Kevin Day [Wed, 2 Apr 2025 02:11:32 +0000 (21:11 -0500)]
Progress: Continue working on completing the remove program.

Clean up the function naming.
The file remove and directory remove structure is rather confusing, name-wise.
Simplify the names.
Now that I know how I intended to implement the callbacks, I can remove unused callbacks.

This is being committed in isolation to allow for better diagnostics.
I will follow this up with additional testing whose changes, if any, will be in additional commits.

I still need to review existing functionality and also resolve incomplete functionality.

11 months agoProgress: Continue working on completing the remove program.
Kevin Day [Tue, 1 Apr 2025 00:53:28 +0000 (19:53 -0500)]
Progress: Continue working on completing the remove program.

Fix recursion parameter to actually work by setting the `kt_remove_depth_max_d` when calling `f_directory_remove()`.
Make sure `--force` works as expected as well as work when not specified (remove unnecessary checks).
Still print verbose messages even when in debug mode while the force parameter is passed.

Oops! I incorrectly used `macro_f_console_parameter_t_initialize_6()` when I instead should have used `macro_f_console_parameter_t_initialize_4()`.
The `macro_f_console_parameter_t_initialize_4()` is for the short parameter type where the `macro_f_console_parameter_t_initialize_6()` is for the simple parameter type.

Finish the `--help` messages for the `rm` program.
Make sure to note that the `--one-file-system` is not supported.

Fix messaage for `--preserve-root=all` error.
Make sure to handle `--preserve-root=/`.

11 months agoUpdate: With latest FLL changes to fll_program.
Kevin Day [Mon, 31 Mar 2025 02:09:52 +0000 (21:09 -0500)]
Update: With latest FLL changes to fll_program.

11 months agoProgress: Continue working on completing the remove program.
Kevin Day [Sun, 30 Mar 2025 03:12:49 +0000 (22:12 -0500)]
Progress: Continue working on completing the remove program.

Implement most of the `rm` program.
There are some remaining details and I need to also test the program.

Move some of the repeated setup code into `kt_remove_setting_load_standard()`.

Add the initial settings needed to support the `--preserve-root` and `--presserve-root-not` support via the newly added `root` flag.
This work is not yet implemented and needs to be completed.

Add support for all programs to return `2` instead of `1` when `F_support_not` is an error return to the main program.
I might end up applying this behavior to all of my FLL and related programs.

The `rm` program in particular has the `--` being manually processed.
I figured given the simple nature of this program that it would be easier to manually pre-process than to utilize the custom callbacks supported by the `f_console_parameter_process()`.

11 months agoProgress: Continue working on completing the remove program.
Kevin Day [Fri, 28 Mar 2025 22:38:06 +0000 (17:38 -0500)]
Progress: Continue working on completing the remove program.

Make sure the `--force` parameter is properly suppressing errors and warnings when a file is not found.
Do not print an error or error out when `--force` is used.
Utilize the `ignore` string and print the boolean state based on `--force` when a file is not found during simulation mode.

Remove the warning on file not found because an error is potentially printed later on.

Update the `--prompt` settings.

Update the program unit tests.
The program now properly returns non-zero on file not found when trying to remove.
The program unit tests are updated to match this expectation.

Update the readme documentation for the remove program.

Fix the standard parameters and properly use `f_console_standard_parameter_last_e`.

Begin adding the `rm` program.

11 months agoProgress: Continue working on completing the remove program.
Kevin Day [Fri, 28 Mar 2025 03:15:01 +0000 (22:15 -0500)]
Progress: Continue working on completing the remove program.

Add the `rmdir` program.

The `install.sh` script doesn't utilize the `-s` parameter.
There only needs to be a single `install.sh` command, which attempts to install everything in the build directory.

Update the version numbers to `0.7.1` just to make relating to the 0.7.x FLL more consistent and obvious.
Eventually these will separate and change in their own ways but for now this is not a problem as there is no official Kevux Tools release.

Change how the `--remember` logic works.
Skip the pre-process entirely if the remember matches.
Do not append a trailing slash for directories.
(There may need to be more code reviews due to the new remember logic and I will have to do this later.)
The `skip` printing in the simulation mode is no longer needed due to this change.

The `--empty` logic along with the `--ignore-fail-on-non-empty` is changed.
I need to rethink the design but for now just make the logic work for `--ignore-fail-on-non-empty`.
This allows for `rmdir` to work as expected with `--ignore-fail-on-non-empty` and without `--ignore-fail-on-non-empty`.

These changes break some of the unit tests.
The `--force` tests also started failing.
It looks like I didn't actually finish those tests and they happened to previously pass so I didn't notice that it is incomplete.
I will come back to these tests later to address them.

11 months agoBugfix: Stand alone builds should not have library.
Kevin Day [Thu, 27 Mar 2025 05:39:22 +0000 (00:39 -0500)]
Bugfix: Stand alone builds should not have library.

The `build_sources_library` is accidentlly being used when instead `build_sources_program` needs to be used.

11 months agoProgress: Continue working on completing the remove program.
Kevin Day [Thu, 27 Mar 2025 03:34:00 +0000 (22:34 -0500)]
Progress: Continue working on completing the remove program.

Update the copyright year.

Add the `unlink` program.
Make sure all necessary callbacks are available to perform this.
Use a custom parameter processing to more closely match the standard Coreutils unlink argument.
I am still preserving some of the core parameters of the FLL/Kevux projects.
(This means that there is the `++version` and the `--version`.)

Fix bug where no error was being printed on non-existent file.
Make sure to also exit on error in this situation.

11 months agoProgress: Continue working on completing the remove program.
Kevin Day [Thu, 27 Mar 2025 01:18:50 +0000 (20:18 -0500)]
Progress: Continue working on completing the remove program.

Use polling on the standard input to allow for blocking in an interruptible way.
Once there is input the file read can be called to read the input.

This finishes the `remove` program development.
I am still designating this as progress because the following wrapper programs now need to be written:
  - `rm`
  - `rmdir`
  - `unlink`

11 months agoProgress: Continue working on completing the remove program.
Kevin Day [Wed, 26 Mar 2025 22:43:56 +0000 (17:43 -0500)]
Progress: Continue working on completing the remove program.

This wraps up most of the `remove` program functionality.
It seems that I already had Time and EpochTime logic in place and I didn't have to do anything.
Add the program unit tests for time and EpochTime.

Fix some documentation comments in the program unit tests.

There is a remaining `@todo` in the `remove` program that will need to be address in the FLL.
I will have to brain storm on how I want to do this and I may end up adding callbacks to all file read and write functions.

11 months agoProgress: Continue working on completing the remove program.
Kevin Day [Wed, 26 Mar 2025 00:24:36 +0000 (19:24 -0500)]
Progress: Continue working on completing the remove program.

Add UNIX Timestamp tests.
Fix date changed tests where I forgot to reset temporary date loop variable assignment before committing.

Add the accessed and updated (modified) time tests.

When recursion is disabled and a directory is being followed, then prevent a double delete by not performing the delete on the "after" at the top level.

Implement the `--prompt` support.
Make sure to take in command line input.
Make sure to quit the program when prompt is one time and the answer is no.

Change the flag to 32-bit for consistency reasons.

11 months agoProgress: Continue working on completing the remove program.
Kevin Day [Tue, 25 Mar 2025 03:01:12 +0000 (22:01 -0500)]
Progress: Continue working on completing the remove program.

Finish some work that I thought I finished in the previous commit.
There were some commented out cases where I was doing controlled manual testing and I forgot to restore the commented out logic.

The Time and EpochTime are not well documented and are also not actually implemented!
Add more of the Time and EpochTime documentation.
I will look into implementing this at a later date.

Add unit tests for the basic Unix Date format.

11 months agoProgress: Continue working on completing the remove program.
Kevin Day [Mon, 24 Mar 2025 02:16:41 +0000 (21:16 -0500)]
Progress: Continue working on completing the remove program.

This adds the yesterday and today program unit tests.

Focus on getting the unit tests working and correcting the logic.
There is a lot of logic surrounding the relative dates and times that makes this ripe for an error.
I will need to add more program unit tests over time to better catch logic mistakes.

11 months agoProgress: Continue working on completing the remove program.
Kevin Day [Sun, 23 Mar 2025 22:54:06 +0000 (17:54 -0500)]
Progress: Continue working on completing the remove program.

Finish setting up any remaining start and stop values.
Make sure the timezone adjustments apply to the stop times.

Remove redundant code in the setting of the timezone.

Use `uint8_t` rather than `f_status_t` for `result` to avoid any potential confusion.

Fix the `time_spec_clocks` date and the `Not` check.

11 months agoProgress: Continue working on completing the remove program.
Kevin Day [Sun, 23 Mar 2025 04:05:42 +0000 (23:05 -0500)]
Progress: Continue working on completing the remove program.

Update the `fakefile` to allow for choosing only just `remove` or just `tacocat`.

Begin adding the date tests.
Fix problems as encountered.
Make the start and end dates initially the same when populated from the clock.

11 months agoProgress: Continue working on completing the remove program.
Kevin Day [Sat, 22 Mar 2025 16:41:33 +0000 (11:41 -0500)]
Progress: Continue working on completing the remove program.

The existing program unit tests revealed that the date pre-processing is:
1. Happening even when none of the date flags (access, changed, and updated) are set.
2. Is incorrectly returning `F_yes` due to the initial `F_okay` assignment to `status`.

Add `accessed_changed_updated` helper flag and use that flag to ensure the `kt_remove_preprocess_file_dates()` only gets called when needed.

Initialize the `status` value to `F_false` in the `kt_remove_preprocess_file_dates()`.

The newly added pint functions is resulting in an extra call to `geteuid()`.
Add a second wrap call to address this.
I may want to use a variable in the future to prevent multiple calls to this function.

11 months agoProgress: Continue working on completing the remove program.
Kevin Day [Sat, 22 Mar 2025 03:18:53 +0000 (22:18 -0500)]
Progress: Continue working on completing the remove program.

Utilize the FLL file type strings.
Merge the separate file stat printing into the simulate function and create the appropriate print functions.

Fix the loop variable name order ('i' before 'j').
Fix the printing of the Time and EpochTime units.
Print the time units on the same line as the `updated`, `accessed`, and `changed`.

Improve error printing for user and group IDs when the ID is not found or too large.

11 months agoThis provides changes that were documented in that commit.
Kevin Day [Fri, 21 Mar 2025 03:12:49 +0000 (22:12 -0500)]
This provides changes that were documented in that commit.

Fix the `--force` flag, which essentially means that it must ignore missing files.
Update the help documentation regarding this.

The file stat printing function is very redundant and should be combined into the simulate function.
I noticed that the date based pre-processing is only in the printing and is not yet toggling the flags.
Begin moving this over.
I decided to make a separate function to handle this given its size.

Reset the `!(^)` check back to a `==`.
The compiler should be able to determine the most efficient operation and using plain `==` is just more readable.

Add some additional help messages describing how  the `<` and `>` characters must be quoted to prevent them being used as redirect characters.

Is `stop_year` not being used when it should be?
Plan on investigating this.

Be more consistent with the parameter handling strings in the program unit tests.

Add the unit tests for `--force`.

11 months agoThis provides changes that were documented in that commit.
Kevin Day [Thu, 20 Mar 2025 03:16:28 +0000 (22:16 -0500)]
This provides changes that were documented in that commit.

Use the `^` operator (XOR) to determine if mode is different or the same.

Add file mode program unit tests.

11 months agoProgress: Continue working on completing the remove program.
Kevin Day [Tue, 18 Mar 2025 23:05:38 +0000 (18:05 -0500)]
Progress: Continue working on completing the remove program.

I forgot to perform the `git add` for the previous commit bf990a10a2c24f6304bb04dc2569765abb5b2347.

This includes changes that were supposed to be in that commit.

Add file type based program unit tests.
Add user based program unit tests.
Add group based program unit tests.

Fix bug exposed by the program unit tests where the id tests are only being performed as a group test even when it needs to be a user test.
This is fixed by creating and passing the `is_user` boolean to the functions.

Fix bug exposed by the program unit tests where the `--same` and `--different` boolean logic is reversed resulting in `--same` removing for different users and `--different` removing for the same user.

11 months agoProgress: Continue working on completing the remove program.
Kevin Day [Tue, 18 Mar 2025 01:20:32 +0000 (20:20 -0500)]
Progress: Continue working on completing the remove program.

Add more recurse simple program unit tests.
Add the tree simple program unit tests.

Implement the tree delete operation.
Relocate the parent directory pre-process to a loop that is processed after all other files and directories are removed.

11 months agoProgress: Continue working on completing the remove program.
Kevin Day [Mon, 17 Mar 2025 03:55:14 +0000 (22:55 -0500)]
Progress: Continue working on completing the remove program.

Add the first more complex file removal runtime unit tests.
I may start calling these "program unit tests" as that sounds more accurate than "runtime unit tests".

The `f_directory_is()` should not be needed because the `fl_directory_do()` already passed a flag designating that the path is or is not a directory.
Remove the calls to `f_directory_is()` and instead use the appropriate flag.

Add `directory_parent` helper flag.

Report whether or not the path is a parent path when using tree mode.
The tree mode has changes in this commit that are not yet tested and need to be tested.
I should write a program unit test for this as well.

The "list" flag is not needed for the `fl_diectory_do()` processing.

The `parent` and `child` flags are now used differently.
The `parent` flag is now used to represent a parent directory only in the case where tree mode is enabled and the directory is only a parent directory do to parent tree traversal.
The `child` flag is now used to represent recursion from some directory.
The recursion cannot happen on a `parent` as the tree mode does not support recursion on a parent.
The `child` is passed to any directory or file that is being recursed into.
The lack of the `child` flag should designate that this is a top-level directory as far as recursion is concerned.

Fix an issue where the wrong flag is being used for the `flag_operate` `directory` flag.

Both the `kt_remove_operate_file_directory()` and the `kt_remove_preprocess_file()` should have the directory and parent flags cleared when called via pre-process recursion.
The pre-process recursion does not need to pass any flags to the recursion callback (via the `recurse.flag`).
The operate recursion does not need to pass the list flag to the recursion callback (via the `recurse.flag`).
Make sure the directory state is preserved by mapping the flag from the `fl_directory_do()` to a flag for the kt_remove file operations.

12 months agoProgress: Continue working on completing the remove program.
Kevin Day [Wed, 12 Mar 2025 03:06:33 +0000 (22:06 -0500)]
Progress: Continue working on completing the remove program.

Add more runtime unit tests.

This begins adding simple directory recurse tests.
The current test written for this is incomplete and needs the `fl_directory_do()` to be unwrapped.
Then the individual parts need to be mocked as needed.

12 months agoProgress: Continue working on completing the remove program.
Kevin Day [Tue, 11 Mar 2025 04:47:08 +0000 (23:47 -0500)]
Progress: Continue working on completing the remove program.

Fix a bug exposed by the directory unit tests where the `recurse.path_top` is not being defined and must be.
Add additional safety checks to fall back to a NULL string if `recurse.path_top` is NULL.

Add basic file and directory tests.
There are still a lot more tests to write.
This should be an acceptable start.

Refresh the stand alone build settings and config.h files.

12 months agoProgress: Continue working on completing the remove program.
Kevin Day [Mon, 10 Mar 2025 03:22:43 +0000 (22:22 -0500)]
Progress: Continue working on completing the remove program.

I discovered that the `fl_directory_do()` could use some improvements while working on this.
Those changes are now made in the FLL project.
Make changes to this project based on the `fl_directory_do()` updates.

I began writing some tests and I encountered several problems and concerns that side-tracked me.

Rename the `kt_remove_operate_file_recurse()` to `kt_remove_operate_file_directory()`.
This should make its design and purpose more clear.

Make sure that the recurse status is processed in the proper order for the file operation directory.
Fix the problem where the recursion is being performed even when the recurse flag is not set.
Add checks to see if the directory is empty or not before deleting when recursion is not enabled.
The flag (called code in this case) needs to accurately reflect the directory status of the file during recursion.
Make sure the recurse error handler uses the top path or the recurse path as appropriate.

Print debug messages before recursion begins.

Add missing `f_status_t` return states to several print functions.
I did not do an exhaustive look (I imagine the TacocaT program needs similar changes).
Fix problems where the program output is being used for the print functions rather than the print output.

The runtime unit tests do not work correctly because the standard outputs are being closed.
Add additional ifdef checks to prevent the set down functions from being called.

12 months agoProgress: Continue working on completing the remove program.
Kevin Day [Sat, 8 Mar 2025 05:37:15 +0000 (23:37 -0600)]
Progress: Continue working on completing the remove program.

This adds the beginnings of the runtime, unit test like, testing.
This approach for a runtime test is being done to make mocking functions easier.
The goal here is to not have actual files created and especially to have no files actually deleted.

If the delete doesn't work properly, then there should be no consequences due to not actually running any real deletes.

The current state of this simply tests the help and version parameters.
I chose this as a way to hash out the process that I am going to use.

This fixes a mistake in the individual library link name for `-lfl_directory`.

Remove unused `kt_remove_main_t *main ` declaration.

Fix documentation comments for several header files.

12 months agoUpdate: The fll_error dependencies.
Kevin Day [Fri, 21 Feb 2025 03:07:51 +0000 (21:07 -0600)]
Update: The fll_error dependencies.

This brings the code in line with the recent centralized string design.

12 months agoProgress: Continue working on completing the remove program.
Kevin Day [Thu, 20 Feb 2025 04:07:11 +0000 (22:07 -0600)]
Progress: Continue working on completing the remove program.

Implement the memory cache for the remember parameter.