• 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
NSTask send commands via standardInput
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSTask send commands via standardInput


  • Subject: NSTask send commands via standardInput
  • From: RenĂ© Korthaus <email@hidden>
  • Date: Sat, 27 Nov 2004 21:58:46 +0100

Hello everybody,

i am running an NSTask and while running i want to send commands to this task. I now googled half a day and only found this code:

NSString * commandString = [commandField stringValue]; // this is my command
/* this is what i found on the web */
NSData * commandToSend = [commandString dataUsingEncoding:NSUTF8StringEncoding];
[[[qemu standardInput] fileHandleForWriting] writeData:commandToSend];

I have a NSTextView where i see the output of the task, but when i send, lets say quit via the commandField (NSTextField), nothing happens to my task and the output says "qququiquit". That's with all commands i pass to the task.

Anybody has a clue or any working example for sending commands to an NSTask?

Thanks in advance,
René Korthaus
-------------------------------------------------------------
The signature is currently on vacations.
 _______________________________________________
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: NSTask send commands via standardInput
      • From: Andrew Farmer <email@hidden>
  • Prev by Date: Re: NSObject hierarchy browser
  • Next by Date: Re: NSTask send commands via standardInput
  • Previous by thread: Re: NSObject hierarchy browser
  • Next by thread: Re: NSTask send commands via standardInput
  • Index(es):
    • Date
    • Thread