Re: NSTask, NSPipe's and interactive UNIX command
Re: NSTask, NSPipe's and interactive UNIX command
- Subject: Re: NSTask, NSPipe's and interactive UNIX command
- From: Nicola Vitacolonna <email@hidden>
- Date: Thu, 3 Jan 2002 14:57:32 +0100
Buffering of stdout is line-buffered by default if the output file
descriptor is a tty (or pty); otherwise, block buffered. stderr is by
default unbuffered. The setvbuf() function is used to change the
buffering mode. These are all standard BSD UNIX (and maybe general
UNIX) things I've described here.
NSTask does not do any setting up of ttys/ptys for you. It wouldn't
help in this case anyway since the printfs aren't printing out \n.
Ok, you can assume that my output actually prints \n in each printf().
My question is: is there a way to set up a pty in Cocoa using NSPipe and
NSTask? Or should I use standard C libraries to do the job (I've been
suggested to make a thread, use a standard read() and set up
communication with NSConnection).
Regards,
Nicola