• 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: Interacting with an NSTask via pipes
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Interacting with an NSTask via pipes


  • Subject: Re: Interacting with an NSTask via pipes
  • From: Ingvar Nedrebo <email@hidden>
  • Date: Thu, 7 Feb 2002 19:08:01 +0000

On Thursday, February 7, 2002, at 06:31 , Tony Gray wrote:

What I find particularly difficult to fathom is why my perl script (with
buffering turned on) and the process I eventually hope to drive work
properly from a shell, but as soon as I try to drive them as as NSTask, the
buffering changes their behaviour completely. It's like the shell is able
to force a buffer flush as well.

The stdio package (printf & friends) will do line buffering when it's talking to a terminal device, i.e. the buffer is flushed after each newline. This does not happen if it is talking to a pipe or a file.

You can make a program think that it talking to a terminal. This is called a pseudo tty and is what Terminal.app uses. I don't have experience programming these myself, but look at 'man 3 openpty', and also do a search on the Darwin developers list, where there was a thread on ptys a couple of months ago.

Regards,
Ingvar
_______________________________________________
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.

References: 
 >Re: Interacting with an NSTask via pipes (From: Tony Gray <email@hidden>)

  • Prev by Date: Memory mania
  • Next by Date: Disable the drag snap-back?
  • Previous by thread: Re: Interacting with an NSTask via pipes
  • Next by thread: Printing a border around text
  • Index(es):
    • Date
    • Thread