FROM : Jens Alfke
DATE : Thu Mar 06 22:06:37 2008
On 6 Mar '08, at 12:35 PM, Charles Ross wrote:
> However, the following code, when run from a simple Foundation Tool
> I built to figure out what's going on, never gets to the second
> NSLog statement, even after running for more than ten minutes. Is
> this process really taking that long or am I missing something?
I think the pipe blocks because the file handle's buffer fills up. You
don't have any code that reads the data from the file handle. If you
want to buffer all of the output into memory, you'll have to write
code to do that yourself (although it would be better to process the
lines incrementally.)
FYI, in general if you're wondering what a process is taking time
doing, the quickest way to find out is to use Activity Monitor, or the
"sample" command, to sample it for a few seconds .
—Jens
DATE : Thu Mar 06 22:06:37 2008
On 6 Mar '08, at 12:35 PM, Charles Ross wrote:
> However, the following code, when run from a simple Foundation Tool
> I built to figure out what's going on, never gets to the second
> NSLog statement, even after running for more than ten minutes. Is
> this process really taking that long or am I missing something?
I think the pipe blocks because the file handle's buffer fills up. You
don't have any code that reads the data from the file handle. If you
want to buffer all of the output into memory, you'll have to write
code to do that yourself (although it would be better to process the
lines incrementally.)
FYI, in general if you're wondering what a process is taking time
doing, the quickest way to find out is to use Activity Monitor, or the
"sample" command, to sample it for a few seconds .
—Jens
| Related mails | Author | Date |
|---|---|---|
| Charles Ross | Mar 6, 21:35 | |
| Jens Alfke | Mar 6, 22:06 | |
| Gerd Knops | Mar 10, 22:39 |






Cocoa mail archive

