I have a button in my Preference Bundle for my iOS tweak and I'm trying to have it delete a cache file so that the tweak will work properly.
The function for the button is here
- (void)respring {
system("cd /var/mobile/Library/Caches/com.apple.keyboards");
system("rm -R images");
system("rm version");
}
When I go into iFile afterwords the file is still there and hasn't deleted. Is there a way around this?
I haven't tested this, but my guess is that you are running three separate commands, with system()
.
So, you run one command to change directory, and then nothing else.
The second command to rm -R images
is then run by itself, and not performed with /var/mobile/Library/Caches
as the current directory.
You might try simply combining all three commands into one:
system("cd /var/mobile/Library/Caches/com.apple.keyboards; rm -R images; rm version");
If that doesn't work, report back and maybe there's another problem.