• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Debugging Stdout
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Debugging Stdout


  • Subject: Re: Debugging Stdout
  • From: Frode <email@hidden>
  • Date: Tue, 4 Oct 2005 14:20:31 +0200

Hello!
I'm not sure but maybe your problem is that bytes piped to another tool's input is consumed by that input and not copied to your data-available notification (NSFileHandleReadCompletionNotification/ NSFileHandleReadToEndOfFileCompletionNotification) other than the last EOF-notification? I don't know if there is any other way than creating another piped NSTask in your debugging code, where you execute an own implemented tool, say "broadcast_stdin" with arguments specifiying destination outputs. For example, in the shell it would look like


#original command: ls -R / | less -RSe
ls -R / | broadcast_stdin /dev/stdout myfile.txt | less -RSe

Hope this helps!
Roger

2005-10-04 kl. 03.20 skrev Ronnie O:

Hello all,
Can anyone give me some ideas for debugging a failed data return from
stdout? I have code using NSTask setup to pipe text into a program and have
the program echo the text data back. The code I put together works fine for
a perl script that i put together, but I am not getting the data returned
when i pipe to a c program. I replaced a readInBackgroundAndNotify with a
waitForDataInBackgroundAndNotify and I am getting notification of available
data for the perl call but not the c call. When I run the piped command of
the c program from the command line, the data is piped out to the screen. I
am calling the same program from my cocoa app with a flag to pipe output to
stdout, but I just can't get any data through the pipe. Are there any
obvious reasons why my cocoa app would see data from stdout differently from
a perl or c program? Like I said, I am using the same code for both calls
and I know data is getting into both tasks from the debug files. I just
don't know how to debug any more finely. I do know that an
NSFileHandleConnectionAcceptedNotification is being posted in both cases, so
the task end of the pipe is being seen by the task. I just don't know where
the missing link between stdout and the task end is. How can I find where
stdout is going? Thanks all!

_______________________________________________ Do not post admin requests to the list. They will be ignored. Cocoa-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
  • Follow-Ups:
    • Re: Debugging Stdout
      • From: Sherm Pendley <email@hidden>
    • Re: Debugging Stdout
      • From: Alastair Houghton <email@hidden>
References: 
 >Debugging Stdout (From: Ronnie O <email@hidden>)

  • Prev by Date: testing exchangedata
  • Next by Date: SenTestingKit and debugging UnitTests
  • Previous by thread: Re: Debugging Stdout
  • Next by thread: Re: Debugging Stdout
  • Index(es):
    • Date
    • Thread