OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2009, Google Inc. | 2 * Copyright 2009, Google Inc. |
3 * All rights reserved. | 3 * All rights reserved. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions are | 6 * modification, are permitted provided that the following conditions are |
7 * met: | 7 * met: |
8 * | 8 * |
9 * * Redistributions of source code must retain the above copyright | 9 * * Redistributions of source code must retain the above copyright |
10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
92 [task setArguments:[NSArray arrayWithObjects:@"-E", in_filename_ns, | 92 [task setArguments:[NSArray arrayWithObjects:@"-E", in_filename_ns, |
93 @"-o", out_filename_ns, nil]]; | 93 @"-o", out_filename_ns, nil]]; |
94 | 94 |
95 // We send the output to a pipe, even though the tool doesn't really | 95 // We send the output to a pipe, even though the tool doesn't really |
96 // output anything. This is so that the invocation of the command | 96 // output anything. This is so that the invocation of the command |
97 // will be synchronous, and we can be sure that the output file has | 97 // will be synchronous, and we can be sure that the output file has |
98 // been written by the time we exit this function. | 98 // been written by the time we exit this function. |
99 NSPipe *pipe = [NSPipe pipe]; | 99 NSPipe *pipe = [NSPipe pipe]; |
100 [task setStandardOutput:pipe]; | 100 [task setStandardOutput:pipe]; |
101 [task launch]; | 101 [task launch]; |
102 NSData *data = [[pipe fileHandleForReading] readDataToEndOfFile]; | 102 [[pipe fileHandleForReading] readDataToEndOfFile]; |
103 return true; | 103 return true; |
104 } | 104 } |
105 } // end namespace o3d | 105 } // end namespace o3d |
OLD | NEW |