Liste des Groupes | Revenir à cu programmer |
In article <vh9vgr$5bb$1@dont-email.me>, <Muttley@dastardlyhq.com> wrote: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?
I think the short answer to your question is: No.
>
There's no way to directly do what you want in a clean way.
>
Thus, all we have is kludgey workarounds. And I'm sure you've got plenty
of your own kludgey workarounds; you don't need any more from me.
>
That said, if was me, I'd use Expect. A few lines of Expect would do it,
such that I could send text to the process and the process would think they
were coming from a tty. In fact, if you don't want to learn Expect (i.e.,
Tcl) just for this project, I think just using "unbuffer -p" (unbuffer is a
program that comes with the Expect distribution) would do it for you.
Another way might be to write an interposer so that you could fool the
"say" program into thinking it was talking to a tty even if it wasn't. I
haven't done any Mac programming in a long time (since my Mac stopped
working), but I think interposers were do-able in the Mac ecosystem.
Les messages affichés proviennent d'usenet.