Hello, trying to write a root compiled C script to calculate how many files are in a premade root file. My current strategy is to
- Move into a directory using
<directory name>->cd()
- Then count the number of contents in that directory, possibly using
.ls
and iterating over each line to get the total number of contents.
And append this number to a file. Is there an easier way of doing this or is this a good solution? Also how would I incorporate the root command line methods in a C script?
ROOT Version: 6.26/00
Platform: linuxx8664gcc
Compiler: g++ 9.3.0