• 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
Active Read/Write of NSTask
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Active Read/Write of NSTask


  • Subject: Active Read/Write of NSTask
  • From: Kevin Ferguson <email@hidden>
  • Date: Tue, 06 Oct 2009 16:30:11 -0700

Greetings,

I am working on an application that will allow the user to run a command-line binary from within my program. This is a simple binary written in C. To accomplish this, I am using NSTask to execute the binary. I then output the result of the task to a text view in my program.

All of this works just fine using NSPipe and setting the standard in/output of the task.

I am running into a problem when the binary to be executed contains a scanf statement. I want the user to see results and type in input in real time (like the debugger for standard C tools in xcode). The issue is that as soon as the task hits the scanf statement, the read pipe blocks, so I can't read from it to get data to that point, nor can I tell when it blocks in order to prompt the user for input (preferably using the output up to that point). I know it can be done, I am just completely in the dark as to how/what classes to consider.

Any ideas on how to accomplish what I'm after?

-Kevin
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: Active Read/Write of NSTask
      • From: Ken Thomases <email@hidden>
    • Re: Active Read/Write of NSTask
      • From: Kyle Sluder <email@hidden>
  • Prev by Date: NSLocale currentLocale for Root User
  • Next by Date: Re: I think there's a problem in the documentation for NSComboBox
  • Previous by thread: NSLocale currentLocale for Root User
  • Next by thread: Re: Active Read/Write of NSTask
  • Index(es):
    • Date
    • Thread