Re: [ROOT] open and read files of a directory

From: Rene Brun (Rene.Brun@cern.ch)
Date: Thu Jun 28 2001 - 16:38:16 MEST


Hi Paola,

You may get some inspiration from the following small macro:


{
   //will list all files in the current directory
   void *dirp = gSystem->OpenDirectory("."); 
   const char *afile;
   while(afile = gSystem->GetDirEntry(dirp)) {
      printf("file: %s\n",afile);
   }
}

See other functions in TSystem.h

Rene Brun

Dott.ssa Paola Lecca wrote:
> 
> Dear rooters,
> 
> I need to write a macro that automatically opens and reads all the files
> standing in a directory.
> 
> I did search in old Root talk messagea but I didn't find my case. I'm
> using ROOT Version  3.00/06 under Linux.
> 
> Thanks in advance for any help.
> 
> Paola.



This archive was generated by hypermail 2b29 : Tue Jan 01 2002 - 17:50:50 MET