%s;\n",$ii,$j); } //fprintf($fouttemp,"%s -> %s;\n",$row_name,$col_name); } } } if ($fout !== false) { fwrite($fout,"$endstring"); } //fwrite($fouttemp,"$endstring"); //shell_exec('/usr/bin/dot -Tpng -o /var/www/html/compbio/BNW/graphviz.jpg /var/www/html/compbio/BNW/graphviztemp.txt'); //$file1="./data/".$keyval."run_initialstructure.sh"; //$initiallines=file_get_contents("./data/temp_shell_file_initial_structure"); $file1="/tmp/bnw/".$keyval."run_initialstructure.sh"; $initiallines=file_get_contents("/tmp/bnw/temp_shell_file_initial_structure"); $all_lines="$initiallines"."$keyval\nfi\nexit"; $fp = fopen($file1,"w"); if ($fp !== false) { fwrite($fp, "$all_lines\n"); fclose($fp); } //prepare and execute shell script for matlab with a write lock //$cmd="./runmat.sh $keyval"; //system($cmd); //$str_temp="./data/".$keyval."structure_input_temp.txt"; //$str_temp="/tmp/bnw/".$keyval."structure_input_temp.txt"; //if (file_exists($str_temp)) { shell_exec('./run_scripts/run_octave '.$keyval); //} else { // shell_exec('cp ./data/'.$keyval.'structure_input.txt ./data/'.$keyval.'structure_input_temp.txt'); // shell_exec('cp /tmp/bnw/'.$keyval.'structure_input.txt /tmp/bnw/'.$keyval.'structure_input_temp.txt'); // shell_exec('./run_scripts/run_octave '.$keyval); //} ?>