문제

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top