Logo coherent WaveBurst  
Library Reference Guide
Logo
cwb_rm_report_dir.C
Go to the documentation of this file.
1 /*
2 # Copyright (C) 2019 Gabriele Vedovato
3 #
4 # This program is free software: you can redistribute it and/or modify
5 # it under the terms of the GNU General Public License as published by
6 # the Free Software Foundation, either version 3 of the License, or
7 # (at your option) any later version.
8 #
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
13 #
14 # You should have received a copy of the GNU General Public License
15 # along with this program. If not, see <https://www.gnu.org/licenses/>.
16 */
17 
18 
19 {
21  TB.checkFile(gSystem->Getenv("CWB_ROOTLOGON_FILE"));
22  TB.checkFile(gSystem->Getenv("CWB_PARAMETERS_FILE"));
23  TB.checkFile(gSystem->Getenv("CWB_UPARAMETERS_FILE"));
24 
26  if(gSystem->Getenv("CWB_MERGE_LABEL")==NULL) {
27  cout << "Error : environment CWB_MERGE_LABEL is not defined!!!" << endl;exit(1);
28  } else {
29  cwb_merge_label=TString(gSystem->Getenv("CWB_MERGE_LABEL"));
30  }
31 
32  char rep_dir[1024];
33  sprintf(rep_dir,"%s/%s.%s",report_dir,cwb_merge_label.Data());
34  cout << rep_dir << endl;
35  if(TB.rmDir(rep_dir,true)==true) {
36  cout << "clean publish dir" << endl;
37  char cmd[1024];
38  sprintf(cmd,"rm %s/%s/%s",www_dir,data_label,cwb_merge_label.Data());
39  cout << endl;
40  cout << cmd << endl;
41  gSystem->Exec(cmd);
42  }
43 
44  exit(0);
45 }
exit(0)
TString("c")
char www_dir[512]
Definition: test_config1.C:157
CWB::Toolbox TB
char report_dir[512]
Definition: test_config1.C:149
static bool checkFile(TString fName, bool question=false, TString message="")
Definition: Toolbox.cc:4670
TString cwb_merge_label
char data_label[512]
Definition: test_config1.C:160
char rep_dir[1024]
static bool rmDir(TString dir, bool question=true)
Definition: Toolbox.cc:4767
sprintf(rep_dir,"%s/%s.%s", report_dir, cwb_merge_label.Data())
char cmd[1024]