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

[FEATURE REQUEST] - Ability to delete inside rar #159

Open
karibertils opened this issue Mar 11, 2021 · 11 comments
Open

[FEATURE REQUEST] - Ability to delete inside rar #159

karibertils opened this issue Mar 11, 2021 · 11 comments

Comments

@karibertils
Copy link

If possible, the ability to rm -rf folder to delete the underlying rar files would be very useful.

This might be difficult to implement if there are multiple files inside the rar archive. But at least in my case, if ANY files from inside the rar archive attempt delete, then it's acceptable to delete all the rar files.

This would need to be behind flag since that would be unexpected behaviour for those not aware of how it works.

@hasse69
Copy link
Owner

hasse69 commented Mar 12, 2021

And just deleting from the source folder is not enough?

@karibertils
Copy link
Author

When using things like sonarr which can scan and upgrade media files to higher quality. It causes problem since sonarr cannot delete the old files. You can't scan the source folder since then it can't see the media files.

@hasse69
Copy link
Owner

hasse69 commented Mar 12, 2021

Got it. But how do you foresee this?
I guess it is not the parent folder deletion you wish to trigger on but deletion of actual media files inside archives? So that if the archive holds only that single file it should delete the archive instead? Please describe the use case in detail or it will be hard to estimate amount of work needed.

@karibertils
Copy link
Author

Yes exactly.

If I have multiple folders Video.XX which each contains a rar archive which has inside a single .mkv file. Through rar2fs all applications will see each of these folders as having a single .mkv file.

Sonarr can scan the folders and put upgraded .mkv into each folder where possible. Then afterwards when it tries to delete the previous .mkv it gets cannot remove 'XXXXX.mkv': operation not permitted. The idea was that at that time, instead of error, the system would accept removing the .mkv file and would also remove the underlying .rar archives.

But as I am typing this. I am thinking it would be much better actually, if rar2fs could at the time of delete, mkdir Video.XX/.deletedByRar2fs and move the underlying rar archive files to there. The mounted file system would hide everything that is in .deletedByRar2fs folders. So from the applications point of view the .mkv file was simply removed successfully and is now gone.

Then it would be impossible to have any kind of accidental data loss. But you could also get these kind of tools to work perfectly.

@hasse69
Copy link
Owner

hasse69 commented Mar 12, 2021

Doable I guess. But always moving deleted files to a trash-style folder might not be what you want either. But to allow deletion of an entire archive simply because a single file in it is "deleted", well I need to think about that one. From what I understand it would not be needed to cover your specific use-case anyway and it would appear more consistent not to allow it.

@karibertils
Copy link
Author

Yes you understand correctly. For my use case, moving the archives for deleted files using trash style folder is just perfect. After thinking about it more, I see no reason for deleting the archives instead of just moving them. Looking forward to see if you can come up with a solution.

@hasse69
Copy link
Owner

hasse69 commented Mar 15, 2021

Unfortunately I cannot give you an ETA on this. I am rather busy right now and thus not able to look into it at the moment.

@hasse69
Copy link
Owner

hasse69 commented May 3, 2021

I was thinking, would it matter if actual archive is left as is and that only files get hidden from user?

@karibertils
Copy link
Author

In my case it does not matter as long as there is some way to find which archive files were deleted. To be able to have some script "real" delete them periodically.

@hasse69
Copy link
Owner

hasse69 commented May 3, 2021

So a "fake" file residing under the rar2fs mount point as e.g. .~~some-archive.rar would be good enough to track what files that may be safely removed if it no longer provides any content?

@karibertils
Copy link
Author

Sure, that's fine

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

No branches or pull requests

2 participants