0
我有一个执行TCL脚本的PHP脚本。 TCL脚本创建一个文件,但是当我通过PHP(从浏览器)执行时,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。
error.txt中有什么? – 2009-08-28 11:25:45