Skip to content

Add a FileDelete class #543

Description

@skxeve

I'd like to propose the addition of a FileDelete feature. Currently, there is no dedicated class for simply deleting files.

The class should accept src_dir and src_path arguments, 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.)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    difficulty: easyRequires ability to implement a single module or few small modules, and make unit tests for it.featA new feature

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions