php5.0.0(cli) + loose STDIN when using pcntl_alarm

From: Date: Fri, 16 Jul 2004 23:30:49 +0000
Subject: php5.0.0(cli) + loose STDIN when using pcntl_alarm
Groups: php.general 
Request: Send a blank email to php-general+get-190779@lists.php.net to get a copy of this message
My goal is to parse apache log into a php piped program. I need pcntl_alarm to launch some function, while reading stdin. When exiting of pcntl_alarm function handler, i loose STDIN, php say it's a valid resource, but feof found, since data continu to be send into the pipe. With php5-rc1 it was working, using fopen("php://stdin","r"); With php5-rc2,rc3,0.0.0, it doesn't work, using STDIN I think it's a bug but i'm not sure, please correct me if a make a nonsense. - You will find php sample code at http://exeprod.com/test_cli_signal.txt - To use it you just make something like that : while :; do date; sleep 1; done | /usr/local/bin/php test_cli_signal.php - It will give you output like : sam jui 17 01:29:48 CEST 2004 sam jui 17 01:29:49 CEST 2004 sam jui 17 01:29:50 CEST 2004 je passe dans sig_handler (14) <-- sig_handler() function Already reading from stdin <-- read_stdin() function exiting read_stdin() STDIN: Resource id #1 is_resource(STDIN)=1 Any help will be very appreciated. Critical for me Thanks in advanced.

« previous php.general (#190779) next »