rootalias.C

Go to the documentation of this file.
00001 
00002 //______________________________________________________________________________
00003 void edit(char *file)
00004 {
00005    char s[64], *e;
00006    if (!strcmp(gSystem->GetName(), "WinNT")) {
00007       if (e = getenv("EDITOR"))
00008          sprintf(s, "start %s %s", e, file);
00009       else
00010          sprintf(s, "start notepad %s", file);
00011    } else {
00012       if (e = getenv("EDITOR"))
00013          sprintf(s, "%s %s", e, file);
00014       else
00015          sprintf(s, "xterm -e vi %s &", file);
00016    }
00017    gSystem->Exec(s);
00018 }
00019 
00020 //______________________________________________________________________________
00021 void ls(char *path=0)
00022 {
00023    char s[256] = (!strcmp(gSystem->GetName(), "WinNT")) ? "dir /w " : "ls ";
00024    if (path) strcat(s,path);
00025    gSystem->Exec(s);
00026 }
00027 
00028 //______________________________________________________________________________
00029 void dir(char *path=0)
00030 {
00031    char s[256] = (!strcmp(gSystem->GetName(), "WinNT")) ? "dir " : "ls -l ";
00032    if (path) strcat(s,path);
00033    gSystem->Exec(s);
00034 }
00035 
00036 //______________________________________________________________________________
00037 char *pwd()
00038 {
00039     return gSystem->WorkingDirectory();
00040 }
00041 
00042 //______________________________________________________________________________
00043 char *cd(char *path=0)
00044 {
00045  if (path)
00046    gSystem->ChangeDirectory(path);
00047  return pwd();
00048 }
00049 
00050 //______________________________________________________________________________
00051 void bexec2(char *macro)
00052 {
00053 printf("in bexec dir=%s\n",dir.Data());
00054    if (gROOT->IsBatch()) printf("Processing benchmark: %s\n",macro);
00055    TPaveText *summary = (TPaveText*)bench->GetPrimitive("TPave");
00056    TText *tmacro = summary->GetLineWith(macro);
00057    if (tmacro) tmacro->SetTextColor(4);
00058    bench->Modified(); bench->Update();
00059 
00060    gROOT->Macro(macro);
00061 
00062    TPaveText *summary2 = (TPaveText*)bench->GetPrimitive("TPave");
00063    TText *tmacro2 = summary2->GetLineWith(macro);
00064    if (tmacro2) tmacro2->SetTextColor(2);
00065    bench->Modified(); bench->Update();
00066 }

Generated on Tue Jul 5 15:45:10 2011 for ROOT_528-00b_version by  doxygen 1.5.1