Skip to content
Snippets Groups Projects
Commit 130bc757 authored by Fons Rademakers's avatar Fons Rademakers
Browse files

two new classes to read archive files. TArchiveFile is an abstract class

which uses the plugin manager to load a concrete archive reader. Currently
the TZIPFile class provides a ZIP archive reader. One can also imagine a
TTARFile to read tar files. We advice however to use ZIP archives since they
allow direct access to all its members via a directory structure which
is part of the file. The archive file access has been integrated into TFile
which also functions as byte reader to access the archive. This has the
enormous benefit that archives can be accessed using all the existing
remote file access classes, like TNetFile, TRFIOFile, TCastorFile, etc.

When creating ZIP files containing ROOT files make sure that the ROOT files
are not compressed since normally they are already ZIP compressed. on Linux
one can create a ZIP archive doing:

    zip -n root multi file1.root file2.root file3.root ...

which creates the archive multi.zip, with all files ending with .root
not compressed.

The ROOT files in an archive can be simply accessed like this:

    TFile *f = TFile::Open("multi.zip#file2.root")
or
    TFile *f = TFile::Open("root://pcsalo/multi.zip#2")

where the second form opens the 3rd ROOT file in the archive via rootd.

A TFile can also be used to just browse an archive file, like:

     TFile *f = TFile::Open("multi.zip")
     f->GetArchive->Print()

A TBrowser interface will follow shortly.

The core ZIP reading code has been kindly provided by Lassi Tuura.


git-svn-id: http://root.cern.ch/svn/root/trunk@9420 27541ba8-7e3a-0410-8455-c3a389f83636
parent 14815812
Branches
Tags
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment