Hi,
I'm building cocoa application which launch external command line application.
The command line requires file as an input and output as a file as well.
In the command line will be: nfbtrans <inputFile.txt >outputFile.txt which means take input from inputFile and store the result in outputFile. It works fine.
In cocoa, part of my program is as follows:
NSTask *task;
task = [[NSTask alloc] init];
[task setLaunchPath: @"/usr/local/bin/nfbtrans"];
NSArray *arg;
NSString *inFileArgument = @"</inputFile.txt";
NSString *outFileArgument = @">/out.txt";
arg = [NSArray arrayWithObjects:inFileArgument,outFileArgument, nil];
[task setArguments:arg];
[task launch];
The command line application launched but it said that the inputFile.txt doesn't exist. However, when I check in the directory, the file does exist. I suspect that it has problem with "<" character. Is that any special way to handle special characters arguments?
Thank you in advance.
|