How to delete files only if a key file is missing

Posted:
Thu Mar 22, 2018 9:24 am
by Aquenon
Specifically, I'm discussing deleting leftover files after a rar unarchive. The .rar, .r00, .r01, etc. files are all deleted when the file is unarchived. But what about leftover files such as .par files, .rev files, etc. that might be left. I could set a rule to delete them, but I do not want to delete them until after the file has been unarchived... and the best way I have thought of is to only delete leftover files if the .rar file is missing since that indicates that it has been unarchived.
I have it set to only unarchive after all parts of the archive have not changed for 5 minutes. Now I'm just trying to come up with a good clean up rule.
Thanks
Re: How to delete files only if a key file is missing

Posted:
Thu Mar 22, 2018 11:09 am
by Mr_Noodle
Had to look up par and rev files as I'm not familiar with them. Will need to consider adding support for removing those automatically as well when unarchived.
For now, you can try something like:
- Code: Select all
If (all) are met
If (all) are met for (all files in the same folder)
Name does not match (name)
Extension not is rar
That will match if no rar file with the same name exists in the same folder. You might need to play with it but that's the basic gist.
Re: How to delete files only if a key file is missing

Posted:
Thu Mar 22, 2018 7:32 pm
by Aquenon
That was the piece I was missing.
I did keep trying different things after making this post. I just knew it had to be something with nested conditions, but I got needlessly complicated for a while. I did end up coming up with part of the solution a few hours later, but adding on the name condition was a piece I hadn't considered. Thank you!