[Serusers] Help Using SER FIFO "ser_fifo"

Leo leo at ltcjp.com
Thu Apr 21 05:40:40 CEST 2005


Dear serusers,

I have spent the past several nights trying to figure out how to use the
ser_fifo to send commands and get info back from SER using PHP.
My understanding of using the fifo in SER is to send it
:fifo_command:result_filename. In the example below I am sending the
"ul_dump" command to the fifo and telling to return the result to a file
called "delthis.txt". The file "delthis.txt" never gets created and it
doesn't look like this fifo thing is working at all.

The examples in the admin guide are not helping me. Can anyone one help?


The test PHP code is below:

<html>
<head>
<title>Browser SERCTL </title>
</head>
<body>
<?php
function wrfifo()
{
$fifo_handle = fopen("/tmp/ser_fifo" , "w");
if (!$fifo_handle)
	{
	echo "cannot open ser_fifo<br>";
	return 0;
	}
if (fwrite($fifo_handle, ":ul_dump:/tmp/delthis.txt")==-1)
	{
	echo "cannot write to fifo";
	fclose($fifo_handle);
	return 0;
	}
fclose($fifo_handle);
system("cat /tmp/delthis.txt");
return 1;
}
echo "begin<br>";
$success = wrfifo();
if ($success)
	{
	echo "success<br>";
	}
else
	{
	echo "failure<br>";
	}
?>



Leo Papadopoulos
leo at ltcjp.com


-- 
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.308 / Virus Database: 266.9.18 - Release Date: 4/19/2005
 




More information about the sr-users mailing list