Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support "clean" files #1983

Merged
merged 3 commits into from
Mar 13, 2024
Merged

Conversation

zxkmm
Copy link
Contributor

@zxkmm zxkmm commented Mar 13, 2024

today when i'm debugging, i see it's extremely painful that can't recursive del files or at least del multiple files. (i need to clean up DEBUG dir.)

giving the fact that it COULD be dangerous to implement recursive del in simple way (for example when too much sub-levels in stack and it crashed at the half way by out of ram during del, which could leading damage filesystem),

i decided to implement this clean feature, which will do:

  • select a dir to clean: del all sub-files exclude sub-dirs
  • sel a file to clean: del all files in same dir, exclude dirs and sub-dirs
  • forbid other situation like select . or .. or empty dir etc.

tested with up to 200 files and it done very quick

CONSIDER THIS AS AN WORK AROUND, AND WHEN SOMEONE MADE BETTER IMPLEMENTATION, WE CAN REMOVE THIS FEAT.

@zxkmm zxkmm marked this pull request as ready for review March 13, 2024 10:21
Copy link
Member

@gullradriel gullradriel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Look good to me, thanks ;-)

@gullradriel gullradriel merged commit 14f42d1 into portapack-mayhem:next Mar 13, 2024
3 checks passed
@zxkmm zxkmm deleted the file_del_improvement branch March 13, 2024 18:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants