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 special directory that can always skip trash #5385

Open
SandyXSD opened this issue Dec 17, 2024 · 4 comments
Open

Support special directory that can always skip trash #5385

SandyXSD opened this issue Dec 17, 2024 · 4 comments
Labels
kind/feature New feature or request
Milestone

Comments

@SandyXSD
Copy link
Contributor

What would you like to be added:
Configure a directory (must be empty?) so that all files created under it will be deleted directly, ignoring the trash.

Why is this needed:
Some application may create a lot of temporary files that should be purged completely no matter the trash is enabled or not.

@SandyXSD SandyXSD added the kind/feature New feature or request label Dec 17, 2024
@SandyXSD
Copy link
Contributor Author

We may use the special attribute bit that can be set by chattr:

s      When a file with the 's' attribute set is deleted, its blocks are zeroed and written back to the disk.

@mcassaniti
Copy link

Another reasonable option is to use a user extended attribute. Would a PR be welcome?

@zhijian-pro
Copy link
Contributor

@mcassaniti Getting extended Attributes is an additional metadata overhead

@mcassaniti
Copy link

@zhijian-pro Forgive my naivety, from what you're saying an extended attribute check would require extra DB reads of metadata just to check attribute values during a delete? Do these records need to be touched during a delete currently? I'm guessing no but it pays to check.

Honestly I didn't think about the extra overhead. If the chattr approach is best then I'm happy to look into a PR if the project is willing to take one?

@jiefenghuang jiefenghuang added this to the Release 1.4 milestone Feb 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants