]> Kevux Git Server - kevux-tools/commit
Progress: Continue working on completing the remove program.
authorKevin Day <Kevin@kevux.org>
Sun, 13 Apr 2025 03:12:51 +0000 (22:12 -0500)
committerKevin Day <Kevin@kevux.org>
Sun, 13 Apr 2025 03:51:59 +0000 (22:51 -0500)
commit652dd36aced93465f530079b58a4ace167aca406
tree0389b450758f4ea8ffc8fd85ffa1c8305fb1fb5b
parentf3fb188582c4496c2d1df75f662924f9a0e9e39a
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.
24 files changed:
sources/c/program/kevux/tools/remove/main/common/define.h
sources/c/program/kevux/tools/remove/main/common/type.c
sources/c/program/kevux/tools/remove/main/common/type.h
sources/c/program/kevux/tools/remove/main/operate.c
sources/c/program/kevux/tools/remove/main/operate.h
sources/c/program/kevux/tools/remove/main/preprocess.c
sources/c/program/kevux/tools/remove/main/preprocess.h
sources/c/program/kevux/tools/remove/main/print/error.c
sources/c/program/kevux/tools/remove/main/print/error.h
sources/c/program/kevux/tools/remove/main/print/simulate.c
sources/c/program/kevux/tools/remove/main/print/simulate.h
sources/c/program/kevux/tools/remove/main/remove.c
tests/unit/remove/c/test-remove-date_accessed.c
tests/unit/remove/c/test-remove-date_changed.c
tests/unit/remove/c/test-remove-date_updated.c
tests/unit/remove/c/test-remove-directory_no_args.c
tests/unit/remove/c/test-remove-directory_recurse_simple.c
tests/unit/remove/c/test-remove-epochtime.c
tests/unit/remove/c/test-remove-file_mode.c
tests/unit/remove/c/test-remove-file_type.c
tests/unit/remove/c/test-remove-group.c
tests/unit/remove/c/test-remove-time.c
tests/unit/remove/c/test-remove-unix.c
tests/unit/remove/c/test-remove-user.c