ROOT
6.16/01
Reference Guide
tutorials
rootalias.C File Reference
Tutorials
Detailed Description
Defines aliases:
ls(path)
edit(filename)
dir(path)
pwd()
cd(path)
//______________________________________________________________________________
void
edit(
char
*
file
)
{
char
s
[64], *
e
;
if
(!strcmp(
gSystem
->
GetName
(),
"WinNT"
)) {
if
((
e
= getenv(
"EDITOR"
)))
sprintf(
s
,
"start %s %s"
,
e
,
file
);
else
sprintf(
s
,
"start notepad %s"
,
file
);
}
else
{
if
((
e
= getenv(
"EDITOR"
)))
sprintf(
s
,
"%s %s"
,
e
,
file
);
else
sprintf(
s
,
"xterm -e vi %s &"
,
file
);
}
gSystem
->
Exec
(
s
);
}
//______________________________________________________________________________
void
ls(
char
*path=0)
{
char
s
[256];
strcpy(
s
, (!strcmp(
gSystem
->
GetName
(),
"WinNT"
)) ?
"dir /w "
:
"ls "
);
if
(path) strcat(
s
,path);
gSystem
->
Exec
(
s
);
}
//______________________________________________________________________________
void
dir(
char
*path=0)
{
char
s
[256];
strcpy(
s
,(!strcmp(
gSystem
->
GetName
(),
"WinNT"
)) ?
"dir "
:
"ls -l "
);
if
(path) strcat(
s
,path);
gSystem
->
Exec
(
s
);
}
//______________________________________________________________________________
const
char
*pwd()
{
return
gSystem
->
WorkingDirectory
();
}
//______________________________________________________________________________
const
char
*cd(
char
*path=0)
{
if
(path)
gSystem
->
ChangeDirectory
(path);
return
pwd();
}
TCanvas
*bench = 0;
//______________________________________________________________________________
void
bexec2(
char
*macro)
{
printf(
"in bexec dir=%s\n"
,pwd());
if
(
gROOT
->IsBatch()) printf(
"Processing benchmark: %s\n"
,macro);
TPaveText
*summary = (
TPaveText
*)bench->
GetPrimitive
(
"TPave"
);
TText
*tmacro = summary->
GetLineWith
(macro);
if
(tmacro) tmacro->
SetTextColor
(4);
bench->
Modified
(); bench->
Update
();
gROOT
->Macro(macro);
TPaveText
*summary2 = (
TPaveText
*)bench->
GetPrimitive
(
"TPave"
);
TText
*tmacro2 = summary2->
GetLineWith
(macro);
if
(tmacro2) tmacro2->
SetTextColor
(2);
bench->
Modified
(); bench->
Update
();
}
e
#define e(i)
Definition:
RSha256.hxx:103
gROOT
#define gROOT
Definition:
TROOT.h:410
gSystem
R__EXTERN TSystem * gSystem
Definition:
TSystem.h:540
TAttText::SetTextColor
virtual void SetTextColor(Color_t tcolor=1)
Set the text color.
Definition:
TAttText.h:43
TCanvas
The Canvas class.
Definition:
TCanvas.h:31
TCanvas::Update
virtual void Update()
Update canvas pad buffers.
Definition:
TCanvas.cxx:2286
TNamed::GetName
virtual const char * GetName() const
Returns name of object.
Definition:
TNamed.h:47
TPad::Modified
void Modified(Bool_t flag=1)
Definition:
TPad.h:415
TPad::GetPrimitive
virtual TObject * GetPrimitive(const char *name) const
Get primitive.
Definition:
TPad.cxx:2847
TPaveText
A Pave (see TPave) with text, lines or/and boxes inside.
Definition:
TPaveText.h:21
TPaveText::GetLineWith
virtual TText * GetLineWith(const char *text) const
Get Pointer to first containing string text in this pavetext.
Definition:
TPaveText.cxx:289
TSystem::Exec
virtual Int_t Exec(const char *shellcmd)
Execute a command.
Definition:
TSystem.cxx:662
TSystem::ChangeDirectory
virtual Bool_t ChangeDirectory(const char *path)
Change directory.
Definition:
TSystem.cxx:869
TSystem::WorkingDirectory
virtual const char * WorkingDirectory()
Return working directory.
Definition:
TSystem.cxx:878
TText
Base class for several text objects.
Definition:
TText.h:23
TGeoUnit::s
static constexpr double s
Definition:
TGeoSystemOfUnits.h:162
file
Definition:
file.py:1
Author
Rene Brun
Definition in file
rootalias.C
.