Re: Piping into script...
| From: | David Robley | Date: | Wed, 21 Nov 2001 04:15:59 +0000 |
| Subject: | Re: Piping into script... | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-75347@lists.php.net to get a copy of this message | ||
On Wed, 21 Nov 2001 13:04, Ashley M. Kirchner wrote:
> If I want to pipe, say an incoming email to a PHP script (assuming
> I have php compiled as a cgi binary), how do I deal with when it needs
> to receive the stream of data, how to figure out when there is no more
> coming before it actually start to parse the information?
Steve Werby has answered this for you.
> And how do people deal with multiple requests and such? There may
> be cases where there could be more than one email incoming at the same
> time...while theoretically the MTA only passes them one by one to
> whatever's next in line (whether it's procmail, or any other type of
> program)
The OS will take care of this by firing up another instance of
your script. All you need to do is be aware of the possibility of
multiple instances doing ?things? at around the same time and make sure
that you don't have say several instances all writing to the same file at
the same time - use locking where it is not provided by the tool you are
using.
--
David Robley Techno-JoaT, Web Maintainer, Mail List Admin, etc
CENTRE FOR INJURY STUDIES Flinders University, SOUTH AUSTRALIA
Flirt: A woman who thinks it's every man for herself.