style(rm): wrap long line in prompt_file_with_stat macro for readability
Reformatted the prompt_yes! macro call across multiple lines to improve code readability and adhere to line length conventions. No functional changes.
38d339d
4 hours ago
by mattsu2020
-14.61%
refactor(linux/rm): refactor safe_remove_dir_recursive for better FD management and error handling
Restructure directory opening and traversal logic to collect entries upfront and drop DirFd early, preventing deep descriptor stacks. Improve permission denied error handling to match GNU rm behavior while maintaining secure operations. This enhances resource efficiency and compatibility without altering functional behavior.
bf28c9a
2 hours ago
by mattsu2020
+2.8%
feat(rm): add progress bar support to recursive dir removal on Linux
Refactor `safe_remove_dir_recursive_impl` to accept an optional `ProgressBar` parameter instead of `dir_fd`, opening the directory internally. Add progress increments for each removed item to improve user feedback during long recursive operations.
6a9f123
2 hours ago
by mattsu2020
0%
refactor(rm): simplify control flow in safe_remove_dir_recursive_impl
Replaced nested if-else logic with direct else-if in the file removal path to reduce code nesting and improve readability for handling interactive prompts during recursive directory removal.
2957789
2 hours ago
by mattsu2020
0%
refactor: remove handle_permission_denied function from rm linux platform
Remove the obsolete `handle_permission_denied` helper function in `src/uu/rm/src/platform/linux.rs`. This function was handling permission denied errors when attempting to remove subdirectories during recursive removal. Its removal simplifies the code and aligns with updated error handling logic, potentially avoiding redundant or buggy behavior in edge cases. The change maintains compatibility for standard rm operations while reducing complexity.
1f78fc6
2 hours ago
by mattsu2020
-2.8%
perf(linux/rm): optimize descriptor usage by keeping dir_fd open in safe_remove_dir_recursive_impl
Reuse the existing directory file descriptor instead of opening/closing new ones for each subdirectory or file during recursive removal. This simplifies the code, reduces overhead from descriptor management, and prevents potential deep descriptor stacks on systems with many nested directories. Removed unnecessary `drop(dir_fd)` call and adjusted progress bar increments accordingly.
188d9cf
2 hours ago
by mattsu2020
-2.41%
style(rm): reformat error assignment in safe_remove_dir_recursive_impl
Break the long error assignment line for better readability, ensuring consistent code formatting in the rm utility's Linux platform implementation.
fbb0fd9
2 hours ago
by mattsu2020
+5.15%
fix: prevent file descriptor buildup in recursive rm on Linux
Drop the main directory file descriptor early in `safe_remove_dir_recursive_impl` and open fresh parent FDs per entry unlink to avoid accumulating open file descriptors during recursive directory removal. This resolves potential FD exhaustion issues when removing large directory trees.
971a8bd
1 hour ago
by mattsu2020
-2.75%
refactor(linux/rm): avoid redundant DirFd opening in safe_remove_dir_recursive
Move DirFd opening out of safe_remove_dir_recursive_impl to safe_remove_dir_recursive
to open the directory file descriptor once per level instead of twice, improving efficiency
and reducing potential for errors in recursive directory removal on Linux.
1619870
37 minutes ago
by mattsu2020
+3.15%
refactor(rm/linux): remove mut from dir_fd parameter in safe_remove_dir_recursive_impl
The `dir_fd` parameter was marked as mutable but is not modified within the function,
so removing `mut` enforces Rust's immutability-by-default principle and improves code clarity.
43cccdf
26 minutes ago
by mattsu2020
+0.06%
fix(linux/rm): refactor error handling in safe_remove_dir_recursive_impl
Refactor indentation and nesting in the directory removal logic to improve code readability. Specifically, restructure the error handling branches after checking for PermissionDenied, reducing nested conditions and making the flow more straightforward. This enhances maintainability without changing functionality.