about summary refs log tree commit diff
path: root/sourcecodes/remove_variables.php
diff options
context:
space:
mode:
Diffstat (limited to 'sourcecodes/remove_variables.php')
-rw-r--r--sourcecodes/remove_variables.php12
1 files changed, 9 insertions, 3 deletions
diff --git a/sourcecodes/remove_variables.php b/sourcecodes/remove_variables.php
index 0fd30136..0d925050 100644
--- a/sourcecodes/remove_variables.php
+++ b/sourcecodes/remove_variables.php
@@ -69,17 +69,23 @@ $maxplist=$node-1;
 //print default number of parents
 $pfile=$dir.$keyval."parent.txt";
 $parentf=fopen($pfile,"w");
-fwrite($parentf,"$parent_number\n");
+if ($parentf !== false) {
+  fwrite($parentf,"$parent_number\n");
+}
 
 //print default number of k for model averaging
 $kfile=$dir.$keyval."k.txt";
 $kf=fopen($kfile,"w");
-fwrite($kf,"$k_number\n");
+if ($kf !== false) {
+  fwrite($kf,"$k_number\n");
+}
 
 //print model averaging threshold
 $thrfile=$dir.$keyval."thr.txt";
 $kf=fopen($thrfile,"w");
-fwrite($kf,"$structure_thr\n");
+if ($kf !== false) {
+  fwrite($kf,"$structure_thr\n");
+}
 
 //////////////////Check execution time//////////////////////////////////////////////
 $keyval=valid_keyval($keyval);