tcl php,无法使用通过php执行的tcl创建文件

我有一个执行tcl脚本的PHP脚本。tcl脚本创建一个文件,但是当我通过php(从浏览器)执行时,tcl无法创建文件。

有人能指导我吗?

//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

}

未创建off file report.txt。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值