Re: popen()

From: Date: Fri, 07 Jul 2000 23:51:11 +0000
Subject: Re: popen()
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-5481@lists.php.net to get a copy of this message
In article <4.3.2.7.0.20000706161442.00be6c90@mail.multinet.no>, hjelmis@multinet.no (Kristian Hjelmeland) wrote: > Is there a way to make a persistent pipe to a program, like popen(), only > that it is persistent? > > I'm trying to make a PHP script that manages a Half-life server, and I've > managed to start the server and send commands to it using $fp = > popen($prog, "w"); and fwrite($fp, $command); > > This is working, and the server starts and receives the commands, but is > there a way that I can open the same pipe later to send additional commands > to the server? I don't think you can: PHP cleans up after you and closes all files (and pipes). You could maybe loop inside of that PHP file, and keep things going that way... Java might allow you to create an applet and servlet and keep a pipe open, and PHP can talk to Java in PHP4, so I think you could do something cool that way... -- Richard Lynch | If this was worth $$$ to you, buy a CD US Customer Support Director | from one of the artists listed here: Zend Technologies USA | http://www.L-I-E.com/artists.htm http://www.zend.com | (this has nothing to do with Zend, duh!)

« previous php.general (#5481) next »