-
Notifications
You must be signed in to change notification settings - Fork 18
Add a FileDelete class #543
Copy link
Copy link
Open
Labels
difficulty: easyRequires ability to implement a single module or few small modules, and make unit tests for it.Requires ability to implement a single module or few small modules, and make unit tests for it.featA new featureA new feature
Description
Activity
Metadata
Metadata
Assignees
Labels
difficulty: easyRequires ability to implement a single module or few small modules, and make unit tests for it.Requires ability to implement a single module or few small modules, and make unit tests for it.featA new featureA new feature
I'd like to propose the addition of a
FileDeletefeature. Currently, there is no dedicated class for simply deleting files.The class should accept
src_dirandsrc_patharguments, and all matching files should be targeted for deletion.As an optional feature, I also want the ability to read the file as a text file and delete it only if the number of lines is below a certain threshold. An option to not count empty lines in this line count is also desired.
While other filter conditions such as byte size or file modification time are conceivable, we can hold off on those for now and implement them later, focusing only on the line count condition initially.
If multiple conditions are specified, it's preferable that a file is deleted only if it satisfies ALL conditions (an "AND" logic). (An "OR" logic can be achieved by running the deletion process multiple times with different single conditions.)