ROOT  6.07/01
Reference Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
rootalias.C
Go to the documentation of this file.
1 
2 //______________________________________________________________________________
3 void edit(char *file)
4 {
5  char s[64], *e;
6  if (!strcmp(gSystem->GetName(), "WinNT")) {
7  if ((e = getenv("EDITOR")))
8  sprintf(s, "start %s %s", e, file);
9  else
10  sprintf(s, "start notepad %s", file);
11  } else {
12  if ((e = getenv("EDITOR")))
13  sprintf(s, "%s %s", e, file);
14  else
15  sprintf(s, "xterm -e vi %s &", file);
16  }
17  gSystem->Exec(s);
18 }
19 
20 //______________________________________________________________________________
21 void ls(char *path=0)
22 {
23  char s[256];
24  strcpy(s, (!strcmp(gSystem->GetName(), "WinNT")) ? "dir /w " : "ls ");
25  if (path) strcat(s,path);
26  gSystem->Exec(s);
27 }
28 
29 //______________________________________________________________________________
30 void dir(char *path=0)
31 {
32  char s[256];
33  strcpy(s,(!strcmp(gSystem->GetName(), "WinNT")) ? "dir " : "ls -l ");
34  if (path) strcat(s,path);
35  gSystem->Exec(s);
36 }
37 
38 //______________________________________________________________________________
39 const char *pwd()
40 {
41  return gSystem->WorkingDirectory();
42 }
43 
44 //______________________________________________________________________________
45 const char *cd(char *path=0)
46 {
47  if (path)
48  gSystem->ChangeDirectory(path);
49  return pwd();
50 }
51 
52 TCanvas *bench = 0;
53 //______________________________________________________________________________
54 void bexec2(char *macro)
55 {
56  printf("in bexec dir=%s\n",pwd());
57  if (gROOT->IsBatch()) printf("Processing benchmark: %s\n",macro);
58  TPaveText *summary = (TPaveText*)bench->GetPrimitive("TPave");
59  TText *tmacro = summary->GetLineWith(macro);
60  if (tmacro) tmacro->SetTextColor(4);
61  bench->Modified(); bench->Update();
62 
63  gROOT->Macro(macro);
64 
65  TPaveText *summary2 = (TPaveText*)bench->GetPrimitive("TPave");
66  TText *tmacro2 = summary2->GetLineWith(macro);
67  if (tmacro2) tmacro2->SetTextColor(2);
68  bench->Modified(); bench->Update();
69 }
virtual TObject * GetPrimitive(const char *name) const
Get primitive.
Definition: TPad.cxx:2753
virtual const char * WorkingDirectory()
Return working directory.
Definition: TSystem.cxx:865
virtual Bool_t ChangeDirectory(const char *path)
Change directory.
Definition: TSystem.cxx:856
#define gROOT
Definition: TROOT.h:344
void ls(char *path=0)
Definition: rootalias.C:21
void bexec2(char *macro)
Definition: rootalias.C:54
const char * pwd()
Definition: rootalias.C:39
Base class for several text objects.
Definition: TText.h:42
R__EXTERN TSystem * gSystem
Definition: TSystem.h:545
virtual const char * GetName() const
Returns name of object.
Definition: TNamed.h:51
virtual Int_t Exec(const char *shellcmd)
Execute a command.
Definition: TSystem.cxx:657
The Canvas class.
Definition: TCanvas.h:48
A Pave (see TPave) with text, lines or/and boxes inside.
Definition: TPaveText.h:35
tuple file
Definition: fildir.py:20
ClassImp(TMCParticle) void TMCParticle printf(": p=(%7.3f,%7.3f,%9.3f) ;", fPx, fPy, fPz)
void dir(char *path=0)
Definition: rootalias.C:30
void edit(char *file)
Definition: rootalias.C:3
virtual void SetTextColor(Color_t tcolor=1)
Definition: TAttText.h:57
virtual void Update()
Update canvas pad buffers.
Definition: TCanvas.cxx:2179
const char * cd(char *path=0)
Definition: rootalias.C:45
void Modified(Bool_t flag=1)
Definition: TPad.h:407
virtual TText * GetLineWith(const char *text) const
Get Pointer to first containing string text in this pavetext.
Definition: TPaveText.cxx:267