22 void readdir(TDirectory *dir) {
24 TDirectory *dirsav = gDirectory;
25 TIter next(dir->GetListOfKeys());
27 while ((key = (TKey*)next())) {
28 if (key->IsFolder()) {
29 dir->cd(key->GetName());
30 TDirectory *subdir = gDirectory;
35 TMacro *macro = (TMacro*)key->ReadObj();
37 nlines += macro->GetListOfLines()->GetEntries();
38 if (strstr(key->GetName(),
".h")) nh++;
39 if (strstr(key->GetName(),
".c")) nc++;
40 if (strstr(key->GetName(),
".C")) nC++;
41 if (strstr(key->GetName(),
".py")) npy++;
48 TFile *f =
new TFile(
"code.root");
50 printf(
"File code.root does not exist. Run tutorial importCode.C first\n");
53 printf(
"Reading file ==> code.root\n");
54 printf(
"File size in bytes = %lld\n",f->GetEND());
55 printf(
"File compression factor = %g\n",f->GetCompressionFactor());
59 printf(
"Number of sub-dirs = %d\n",ndirs);
60 printf(
"Number of macro files = %d\n",nfiles);
61 printf(
"Number of lines in mac = %d\n",nlines);
62 printf(
"Number of cxx,c,cc files = %d\n",nc);
63 printf(
"Number of C files = %d\n",nC);
64 printf(
"Number of Python files = %d\n",npy);