我是可可的初学者。我正在尝试执行我的类中的perl脚本,但没有得到任何结果,以下是代码:
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMast, YES);
NSString *documentDir = [paths objectAtIndex:0];
NSString *path = [documentDir stringByAppendingPathComponent:@"detect.pl"];
NSMutableArray *someArray = [[NSMutableArray alloc] initWithObjects:path, nil];
[[NSTask launchedTaskWithLaunchPath:[NSString stringWithFormat:@"/usr/bin/pl"] arguments:someArray] waitUntilExit];我得到了以下文本
pl {-input <file>} {-output <file>}
Reads ASCII PL from stdin (or file if -input specified)
and writes ASCII PL to stdout (or file if -output)
NOTE: binary serialization is no longer supported 代码的执行就到此为止了。我不知道我做错了什么,有人能给我指个方向吗?谢谢。
发布于 2011-11-17 16:39:47
您需要执行/usr/bin/perl,而不是/usr/bin/pl。
https://stackoverflow.com/questions/8163613
复制相似问题