• 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
Dumping input to NSTask
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Dumping input to NSTask


  • Subject: Dumping input to NSTask
  • From: John Timmer <email@hidden>
  • Date: Wed, 14 Jul 2004 19:19:08 -0400

Greetings -

I'm trying to execute a program via NSTask that works normally by launching,
grabbing input, and then printing output and executing. Typically, I'd
create the input as a text file, then run the program like:

cat inputFile | /path/to/my/program

In trying to do that via NSTask, I've created the input as a string, then
use the string to create an NSData (using UTF8), and then send that through
the task's standard input file handle. The problem is that the task hangs -
it seems to be waiting for the input to terminate, but if I close the file
handle, I crash with invalid memory access.

Any suggestions?

JT


_______________________________________________
This mind intentionally left blank
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.


  • Follow-Ups:
    • Re: Dumping input to NSTask
      • From: "Louis C. Sacha" <email@hidden>
  • Prev by Date: Preventing window selection
  • Next by Date: Re: floats and number formatters
  • Previous by thread: Re: Preventing window selection
  • Next by thread: Re: Dumping input to NSTask
  • Index(es):
    • Date
    • Thread