|
From: | tgate |
Subject: | (no subject) |
Date: | Mon, 11 Dec 2006 15:09:41 -0800 |
This seems to work to pipe data into the program... int main (int argc, const char * argv[]) { NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init]; NSFileHandle *fh = [[NSFileHandle alloc] init]; fh = [NSFileHandle fileHandleWithStandardInput]; NSData *inData = [[NSData alloc] init]; inData = [fh readDataToEndOfFile]; NSString *myString = [[NSString alloc] initWithData: inData encoding: NSUTF8StringEncoding]; [inData release]; NSLog(@"\n%@\n", myString); [pool release]; return 0; } but now how to I add the ability to use my program on the shebang line? Is this not considered standard in? ___ #!/path/to/myProgram and have the input data here? ___ |
[Prev in Thread] | Current Thread | [Next in Thread] |