У меня есть скрипт PHP, который выполняет скрипт TCL. Сценарий TCL создает файл, но когда я выполняю через PHP (из браузера), tcl не может создать файл.
Может ли кто-нибудь направить меня.
// PHP код
<?php
$app = 'tclsh84';
$descriptorspec = array(
0 => array("pipe","r"),
1 => array("file","C:/wamp/www/tcl/bin/out.txt","w"),
2 => array("file","C:/wamp/www/tcl/bin/error.txt","w")
) ;
$process = proc_open($app, $descriptorspec, $pipes);
if (is_resource($process))
{
fwrite($pipes[0], 'source c:/wamp/www/tcl/bin/show.tcl'."\n");
fwrite($pipes[0], ' status 124 mithun '."\n");
fclose($pipes[0]);
proc_close($process);
}
?>
// Код TCL
proc status {id uname} {
set x 1
set outfile [open "report.txt" w]
while {$x < 30} {
set systemTime [clock seconds]
puts $outfile "The time is: [clock format $systemTime -format %H:%M:%S] "
puts $outfile "$id $uname "
set x [expr {$x + 1}]
}
close $outfile
}
Thef файл report.txt не создается.