by [TV] I'm making a mathematical sound rendering web application which is already in a working prototype phase, see here http://www.theover.org/cgi-bin/maxwav.tcl?(sin(2*%pi*110*x)*exp(-2*x)+(1/2)*sin(2*2*%pi*110*x)*exp(-4*x))/(1+(1/2)) There are three tcl scripts involved, which communicate, and the setup allows for application management (for instance parallel use control) and distributed execution of parts (neither currently the case in this setup) and mostly was setup by me to be more safe on a general internet server. This is mainly done so that a user account which has hardly any permissions at all can handle the complicated web request followup calls to maxima, a C/Fortran compiler, latex and gnuplot, and which executes the program resulting from compliling the fortran rendered formula from the math package maxima. What follows are essential parts of the three scripts, but NOT the whole original scripts on the server being actually in use: the cgi-bin tcl script outline: #!/bin/sh # \ exec tclsh "$0" "$@" # puts stdout "Content-type: text/html\n" proc notallowed {a} { puts stdout "This cgi script doesn't allow the use of the character/word\n" puts stdout "
\n   $a\n
\n" puts stdout "in the arguments on the url line, sorry" puts stdout "" puts stdout "" flush stdout exit } puts stdout "" puts stdout "" puts stdout "" puts stdout "" if [string match -nocase {*\[*} $env(QUERY_STRING)] { notallowed \[ } if [string match -nocase {*\]*} $env(QUERY_STRING)] { notallowed \] } if [string match -nocase {*\{*} $env(QUERY_STRING)] { notallowed \{ } if [string match -nocase {*\]*} $env(QUERY_STRING)] { notallowed \] } if [string match -nocase {*\{*} $env(QUERY_STRING)] { notallowed \{ } if [string match -nocase {*\}*} $env(QUERY_STRING)] { notallowed \} } if [string match -nocase {*system*} $env(QUERY_STRING)] { notallowed system } if [string match -nocase {*write*} $env(QUERY_STRING)] { notallowed writefile } if [string match -nocase {*open*} $env(QUERY_STRING)] { notallowed open } set s [socket localhost 1234] #debug/progress info puts stdout "starting math application, progress follows hereafter

" # wait for the results of the other scipts being started above, # stop the cgi when 'end' is received: fileevent $s readable { set t [gets $s] if [string equal $t "end"] { set done 3 ; close $s } { puts stdout $t } flush stdout if [eof $s] { set done 2 } } # some cgi argument character translation, this should be easy in tcl in # a safe and fast way, but I could not find an example set tt [exec echo $env(QUERY_STRING) | sed "s/%20/ /g" | sed "s/%25/%/g" ] # communicate the cgi arguments with the special user script puts $s $tt flush $s # stop the whole thing after little under half a minute after 27000 set done 1 vwait done puts "

First version Page, testing !" puts "

Home Page\n" puts stdout "" puts stdout "" flush stdout exit The matapp deamon on the limited rights user is started like indicated on the page [A Webcam setup with tcl scripts] and is extended with inter-script communication: puts $s $tt flush $s after 27000 set done 1 vwait done puts "

First version Page, testing !" puts "

Home Page\n" puts stdout "" puts stdout "" flush stdout exit I used to pass file pointers (domain socket descriptors) as a good server practice between processes, anyone know how to do this with tcl (see 'advanced tcp/ip programming', addison wesley ' 85 or so) ---- !!!!!! %| enter categories here |% !!!!!!