View Single Post
Old 06-29-2006, 05:24 AM   #4
sepult
Green Mole
 
Join Date: Jun 2006
Posts: 4
Finally, I resolved my problem.
Here is my solution.

I'm using Windows server with apache 2 and can't use command "is_executable", same for "cat" or "type" command shell.

So after robot functions :
if ($usetool) {
rename($tempfile1,$tempfile2);
exec($command,$result,$retval);
unlink($tempfile2);

add :
$f_handler = fopen($tempfile2.$ext,'r');
while (!feof($f_handler)) {
$result[] .= utf8_encode(fgets($f_handler,8192));
}
fclose($f_handler);
unlink($tempfile2.$ext);

and comment lines after :

/*if (!empty($ext)) {
$command = 'type '.$tempfile2.$ext;
exec($command,$result,$retval);
unlink($tempfile2.$ext);
}*/

So for me it works fine.
Bye
sepult is offline   Reply With Quote