I want to run this command via NSTask: mv /User/xxx.deb /User/Docs To move the deb file to /User/Docs. However, the deb file can have many names: blah.deb, blah3.deb, hgfdo.deb, 6745sdjiz.deb,...
Here is my current code:
#import <Foundation/NSTask.h>
NSString *myString = @"deb";
NSPredicate *predicate = [NSPredicate predicateWithFormat:@"entity.name CONTAINS %@", myString];
NSTask *task = [[[NSTask alloc] init] autorelease];
[task setLaunchPath:@"/bin/mv"];
[task setArguments:[NSArray arrayWithObjects:[NSString stringWithFormat:@"/User/%@", predicate], @"/User/Tweak/", nil]];
[task launch];
And that doesn't work. Without the NSPredicate, it works:
[task setArguments:[NSArray arrayWithObjects:@"/User/com.deb", @"/User/Tweak/", nil]];
But I need to use the NSPredicate (or any other method)
Do you have an idea?