• 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 and readInBackgroundAndNotify
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSTask and readInBackgroundAndNotify


  • Subject: NSTask and readInBackgroundAndNotify
  • From: Thomas Lachand-Robert <email@hidden>
  • Date: Sun, 30 Dec 2001 00:51:40 +0100

Hi all,

I'm having problems with NSTask and readInBackgroundAndNotify. In my app, I would like to execute a shell script which has been typed in a text view.
I use an NSTask calling /bin/sh, use parameter -s, passes the script as a input and read the output with readInBackgroundAndNotify. This works.

However /bin/sh doesn't read all the environment variables, so I would like to use /bin/csh or /bin/tsch instead. And here problems occurs. Most of the time I get only some part of the output, for instance for the script:
pwd ; echo "hello" ; ls
I get the pwd and echo, not the ls. (I reiterate that it works with /bin/sh; it tooks me a long time to check that all the output has to be flushed some way before termination).

Even worse: I sometimes get the output in reverse order! (in my example, the echo and THEN the pwd).

I don't understand this different behavior of csh to sh. Any clue would be gretly appreciated.

Thomas Lachand-Robert
********************** email@hidden
<< Et le chemin est long du projet ` la chose. >> Molihre, Tartuffe.


  • Prev by Date: Re: Color in Cocoa
  • Next by Date: Re: menubar rect
  • Previous by thread: Re: Apple's Address Book File Format
  • Next by thread: The Quit menu item
  • Index(es):
    • Date
    • Thread