diff --git a/io/src/TDirectoryFile.cxx b/io/src/TDirectoryFile.cxx index 13e2bcdb04ff9ac03be2e7549e61e0e8ace33489..60154bf16808cc652f051ebd38960a4777396148 100644 --- a/io/src/TDirectoryFile.cxx +++ b/io/src/TDirectoryFile.cxx @@ -1,4 +1,4 @@ -// @(#)root/io:$Name: $:$Id: TDirectoryFile.cxx,v 1.7 2007/02/05 18:09:46 brun Exp $ +// @(#)root/io:$Name: $:$Id: TDirectoryFile.cxx,v 1.8 2007/02/09 10:16:07 rdm Exp $ // Author: Rene Brun 22/01/2007 /************************************************************************* @@ -9,6 +9,21 @@ * For the list of contributors see $ROOTSYS/README/CREDITS. * *************************************************************************/ +//______________________________________________________________________________ +// +// A ROOT file is structured in Directories (like a file system). +// Each Directory has a list of Keys (see TKeys) and a list of objects +// in memory. A Key is a small object that describes the type and location +// of a persistent object in a file. The persistent object may be a directory. +//Begin_Html +/* +<img src="gif/fildir.gif"> +*/ +//End_Html +// +// The structure of a file is shown in TFile::TFile +//______________________________________________________________________________ + #include "Riostream.h" #include "Strlen.h" #include "TDirectoryFile.h" @@ -35,29 +50,8 @@ const UInt_t kIsBigFile = BIT(16); const Int_t kMaxLen = 2048; -//______________________________________________________________________________ -//Begin_Html -/* -<img src="gif/tdirectory_classtree.gif"> -*/ -//End_Html - ClassImp(TDirectoryFile) -//______________________________________________________________________________ -// -// A ROOT file is structured in Directories (like a file system). -// Each Directory has a list of Keys (see TKeys) and a list of objects -// in memory. A Key is a small object that describes the type and location -// of a persistent object in a file. The persistent object may be a directory. -//Begin_Html -/* -<img src="gif/fildir.gif"> -*/ -//End_Html -// -// The structure of a file is shown in TFile::TFile -// //______________________________________________________________________________ TDirectoryFile::TDirectoryFile() : TDirectory() diff --git a/io/src/TFile.cxx b/io/src/TFile.cxx index d1c30708998721451fbf1dd1339c9b53dd9c5394..4e326e9c41073f0f1a72a59caaf6be7254495039 100644 --- a/io/src/TFile.cxx +++ b/io/src/TFile.cxx @@ -1,4 +1,4 @@ -// @(#)root/io:$Name: $:$Id: TFile.cxx,v 1.204 2007/01/29 15:53:35 brun Exp $ +// @(#)root/io:$Name: $:$Id: TFile.cxx,v 1.205 2007/02/09 10:16:07 rdm Exp $ // Author: Rene Brun 28/11/94 /************************************************************************* @@ -9,6 +9,54 @@ * For the list of contributors see $ROOTSYS/README/CREDITS. * *************************************************************************/ +//////////////////////////////////////////////////////////////////////////////// +// A ROOT file is a suite of consecutive data records (TKey's) with +// the following format (see also the TKey class). If the key is +// located past the 32 bit file limit (> 2 GB) then some fields will +// be 8 instead of 4 bytes: +// 1->4 Nbytes = Length of compressed object (in bytes) +// 5->6 Version = TKey version identifier +// 7->10 ObjLen = Length of uncompressed object +// 11->14 Datime = Date and time when object was written to file +// 15->16 KeyLen = Length of the key structure (in bytes) +// 17->18 Cycle = Cycle of key +// 19->22 [19->26] SeekKey = Pointer to record itself (consistency check) +// 23->26 [27->34] SeekPdir = Pointer to directory header +// 27->27 [35->35] lname = Number of bytes in the class name +// 28->.. [36->..] ClassName = Object Class Name +// ..->.. lname = Number of bytes in the object name +// ..->.. Name = lName bytes with the name of the object +// ..->.. lTitle = Number of bytes in the object title +// ..->.. Title = Title of the object +// -----> DATA = Data bytes associated to the object +// +// The first data record starts at byte fBEGIN (currently set to kBEGIN). +// Bytes 1->kBEGIN contain the file description, when fVersion >= 1000000 +// it is a large file (> 2 GB) and the offsets will be 8 bytes long and +// fUnits will be set to 8: +// 1->4 "root" = Root file identifier +// 5->8 fVersion = File format version +// 9->12 fBEGIN = Pointer to first data record +// 13->16 [13->20] fEND = Pointer to first free word at the EOF +// 17->20 [21->28] fSeekFree = Pointer to FREE data record +// 21->24 [29->32] fNbytesFree = Number of bytes in FREE data record +// 25->28 [33->36] nfree = Number of free data records +// 29->32 [37->40] fNbytesName = Number of bytes in TNamed at creation time +// 33->33 [41->41] fUnits = Number of bytes for file pointers +// 34->37 [42->45] fCompress = Zip compression level +// 38->41 [46->53] fSeekInfo = Pointer to TStreamerInfo record +// 42->45 [54->57] fNbytesInfo = Number of bytes in TStreamerInfo record +// 46->63 [58->75] fUUID = Universal Unique ID +//Begin_Html +/* +<img src="gif/file_layout.gif"> +*/ +//End_Html +// +// The structure of a directory is shown in TDirectoryFile::TDirectoryFile +// +//////////////////////////////////////////////////////////////////////////////// + #include "RConfig.h" #include <fcntl.h> @@ -185,50 +233,6 @@ TFile::TFile(const char *fname1, Option_t *option, const char *ftitle, Int_t com // exit(-1); // } // - // A ROOT file is a suite of consecutive data records (TKey's) with - // the following format (see also the TKey class). If the key is - // located past the 32 bit file limit (> 2 GB) then some fields will - // be 8 instead of 4 bytes: - // 1->4 Nbytes = Length of compressed object (in bytes) - // 5->6 Version = TKey version identifier - // 7->10 ObjLen = Length of uncompressed object - // 11->14 Datime = Date and time when object was written to file - // 15->16 KeyLen = Length of the key structure (in bytes) - // 17->18 Cycle = Cycle of key - // 19->22 [19->26] SeekKey = Pointer to record itself (consistency check) - // 23->26 [27->34] SeekPdir = Pointer to directory header - // 27->27 [35->35] lname = Number of bytes in the class name - // 28->.. [36->..] ClassName = Object Class Name - // ..->.. lname = Number of bytes in the object name - // ..->.. Name = lName bytes with the name of the object - // ..->.. lTitle = Number of bytes in the object title - // ..->.. Title = Title of the object - // -----> DATA = Data bytes associated to the object - // - // The first data record starts at byte fBEGIN (currently set to kBEGIN). - // Bytes 1->kBEGIN contain the file description, when fVersion >= 1000000 - // it is a large file (> 2 GB) and the offsets will be 8 bytes long and - // fUnits will be set to 8: - // 1->4 "root" = Root file identifier - // 5->8 fVersion = File format version - // 9->12 fBEGIN = Pointer to first data record - // 13->16 [13->20] fEND = Pointer to first free word at the EOF - // 17->20 [21->28] fSeekFree = Pointer to FREE data record - // 21->24 [29->32] fNbytesFree = Number of bytes in FREE data record - // 25->28 [33->36] nfree = Number of free data records - // 29->32 [37->40] fNbytesName = Number of bytes in TNamed at creation time - // 33->33 [41->41] fUnits = Number of bytes for file pointers - // 34->37 [42->45] fCompress = Zip compression level - // 38->41 [46->53] fSeekInfo = Pointer to TStreamerInfo record - // 42->45 [54->57] fNbytesInfo = Number of bytes in TStreamerInfo record - // 46->63 [58->75] fUUID = Universal Unique ID -//Begin_Html -/* -<img src="gif/file_layout.gif"> -*/ -//End_Html - // - // The structure of a directory is shown in TDirectoryFile::TDirectoryFile if (!gROOT) ::Fatal("TFile::TFile", "ROOT system not initialized");