9fans archive / 1999 / 05 / 23 /    prev next

From: okamoto@gra... okamoto@gra...
Subject: [9fans] Alef program to fork and exec say program
Date: Thu, 13 May 1999 18:11:46 +0900

I'm trying to make my PC termianl read the From header
for a new incoming mail.

After reading the sources in /acme/mail/src, I made small
changes to the function Box.readmore() in box.l like as:

in while() loop to read new comming mails,
	new = true;
	say(buf);      <----added line

and 

defined say() in the box.l file like

void
say(byte *msg)
{
	rfork(RFENVG|RFFDG|RFNOTEG|RFMEM);
	execl("/bin/pub/say", "-l /dev/audio -C 2", "New mail arrived
			from ", msg);
}

After above change, (I really don't know whether the flags 
for rfork() are approapriate) the rsynth program reads and 
speaks! the "From" and "Subject" line when a new mail arrived 
to me.  
However, after that, the Mail program goes into mad, and I 
cann't end the session clearly.
Then, I searched the on-line manuals, and found something
notices for exec() in Alef environment, saying exec() may be
called only from the mail task....

If I want to fork/exec a new program like the present case,
can I do it otherwise?

Kenji