Liste des Groupes | Revenir à cu programmer |
In article <vh9vgr$5bb$1@dont-email.me>,
Muttley@dastardlyhq.com writes:There is a command line util (MacOS "say")* that I wish to use fork-exec'dfrommy own program and send data to it via a socket created by socketpair().it
Unfortunately "say" behaves differently depending on whether its stdin is
attached to a tty or not (and there's no cmd line option to prevent this).
With the former it'll speak after every newline, with the latter not untilgets an EOF and I'd rather not do a fork-exec for each individual word orin
phrase that needs to be spoken.
So my question is - is there a way to set up a pipe or socketpair** so that
it appears to be a tty from the exec'd programs point of view, eg ttyname()
returns non null?
* The MacOS speech API is Objective-C only and completely obtuse.
** Yes I know about the master-slave ptm,pts approach and I have done thatthe past but its complete overkill for this purpose.>
Thanks for any help
Not on a Mac. Use "expect" which does the pts/pty stuff for you.
>
(on a system where pipes are STREAMS based, it might be possible
to come up with a module that made a pipe pretend on one side to be a tty;
but you'd have to get into some nasty kernel coding to do that)
Les messages affichés proviennent d'usenet.