Error in <TFile::Init> file xxxx is truncated

IS there any way to recover data on a corrupted root file? I am using 5.06/0 on win2k reading a file creaated w/ 4.02/0. Here’s result of ctor call:
[ul]root [1] TFile *f = new TFile(“x:/r5_00924.rhit”)
Error in TFile::Init: file x:/r5_00924.rhit is truncated at 27219776 bytes: should be 27219979, trying to recover
Info in TFile::Recover: x:/r5_00924.rhit, recovered key CVoltage:CVoltage at address 727
Info in TFile::Recover: x:/r5_00924.rhit, recovered key CBowl:CBowl at address 2347
Info in TFile::Recover: x:/r5_00924.rhit, recovered key CCalibMass:CCalibMass at address 3314
Warning in TFile::Init: successfully recovered 3 keys
root [2] f->Map()
20051207/130058 At:100 N=164 TFile
20051207/130753 At:264 N=299 TBasket CX = 107.01
Address = 563 Nbytes = -164 =====G A P===========
20051207/130100 At:727 N=1620 CVoltage CX = 2.00
20051207/130100 At:2347 N=967 CBowl
20051207/130100 At:3314 N=945 CCalibMass CX = 1.53
20051207/130723 At:4259 N=267 TBasket CX = 119.84
20051207/130723 At:4526 N=236 TBasket CX = 135.58
20051207/130736 At:4762 N=267 TBasket CX = 119.84
20051207/130736 At:5029 N=236 TBasket CX = 135.58
Address = 5265 Nbytes = -180 =====G A P===========
20051207/130502 At:5445 N=10482 StreamerInfo CX = 3.70
20051207/130736 At:15927 N=569 TBasket CX = 56.24
20051207/130736 At:16496 N=511 TBasket CX = 62.62
Address = 17007 Nbytes = -211 =====G A P===========
20051207/130723 At:17218 N=2299 TBasket CX = 13.92
20051207/130736 At:19517 N=984 TBasket CX = 32.52
20051207/130736 At:20501 N=490 TBasket CX = 65.30
20051207/130736 At:20991 N=447 TBasket CX = 71.58
20051207/130801 At:21438 N=266 TBasket CX = 120.29
Address = 21704 Nbytes = -35 =====G A P===========
20051207/130753 At:21739 N=236 TBasket CX = 135.58
Address = 21975 Nbytes = -117 =====G A P===========
20051207/130723 At:22092 N=3148 TBasket CX = 10.16
20051207/130723 At:25240 N=27678 TBasket CX = 1.16
20051207/130723 At:52918 N=16411 TBasket CX = 1.95
20051207/130723 At:69329 N=1021 TBasket CX = 31.34
20051207/130723 At:70350 N=1925 TBasket CX = 16.62
20051207/130723 At:72275 N=11225 TBasket CX = 2.85
20051207/130723 At:83500 N=9279 TBasket CX = 3.45
20051207/130801 At:92779 N=486 TBasket CX = 65.84
20051207/130801 At:93265 N=447 TBasket CX = 71.58
20051207/130801 At:93712 N=301 TBasket CX = 106.31
20051207/130801 At:94013 N=236 TBasket CX = 135.58
Address = 94249 Nbytes = -29 =====G A P===========
20051207/130753 At:94278 N=632 TBasket CX = 50.63
20051207/130753 At:94910 N=560 TBasket CX = 57.14
20051207/130753 At:95470 N=551 TBasket CX = 58.07
20051207/130808 At:96021 N=236 TBasket CX = 135.58
Address = 96257 Nbytes = -6 =====G A P===========
20051207/130736 At:96263 N=4449 TBasket CX = 7.19
20051207/130736 At:100712 N=24019 TBasket CX = 1.33
20051207/130736 At:124731 N=15505 TBasket CX = 2.06
20051207/130736 At:140236 N=14756 TBasket CX = 2.17
20051207/130736 At:154992 N=11216 TBasket CX = 2.85
20051207/130736 At:166208 N=3231 TBasket CX = 9.90
20051207/130808 At:169439 N=266 TBasket CX = 120.29
20051207/130808 At:169705 N=457 TBasket CX = 70.02
20051207/130808 At:170162 N=420 TBasket CX = 76.19
20051207/130808 At:170582 N=478 TBasket CX = 66.94
20051207/130808 At:171060 N=379 TBasket CX = 84.43
Address = 171439 Nbytes = -86 =====G A P===========
20051207/130753 At:171525 N=23694 TBasket CX = 1.35
20470726/160107 At:195219 N=1035076587 CX = 2.02
20470726/160107 At:1035271806 N=1 END
root [3] f->GetStreamerInfoList()->Print()
OBJ: TStreamerInfo CLasHeader
OBJ: TStreamerInfo TObject
OBJ: TStreamerInfo TStreamerInfo
OBJ: TStreamerInfo TNamed
OBJ: TStreamerInfo TStreamerElement
OBJ: TStreamerInfo TStreamerString
OBJ: TStreamerInfo TStreamerBasicType
OBJ: TStreamerInfo TStreamerBasicPointer
OBJ: TStreamerInfo TStreamerLoop
OBJ: TStreamerInfo TStreamerObject
OBJ: TStreamerInfo TStreamerObjectPointer
OBJ: TStreamerInfo TStreamerObjectAny
OBJ: TStreamerInfo TF1
OBJ: TStreamerInfo TFormula
OBJ: TStreamerInfo TAttLine
OBJ: TStreamerInfo TAttFill
OBJ: TStreamerInfo TAttMarker
OBJ: TStreamerInfo TList
OBJ: TStreamerInfo TSeqCollection
OBJ: TStreamerInfo TCollection
OBJ: TStreamerInfo TString
OBJ: TStreamerInfo CEfficiency
OBJ: TStreamerInfo TH1F
OBJ: TStreamerInfo TH1
OBJ: TStreamerInfo TArrayF
OBJ: TStreamerInfo TArray
OBJ: TStreamerInfo TAttAxis
OBJ: TStreamerInfo THashList
OBJ: TStreamerInfo TArrayD
OBJ: TStreamerInfo TGraphErrors
OBJ: TStreamerInfo TH1D
OBJ: TStreamerInfo TAxis
OBJ: TStreamerInfo TProfile
OBJ: TStreamerInfo TGraph
OBJ: TStreamerInfo TTree
OBJ: TStreamerInfo TBranch
OBJ: TStreamerInfo TLeafS
OBJ: TStreamerInfo TLeaf
OBJ: TStreamerInfo TLeafI
OBJ: TStreamerInfo TLeafF
OBJ: TStreamerInfo TVirtualIndex
OBJ: TStreamerInfo TBranchRef
OBJ: TStreamerInfo TRefTable
OBJ: TStreamerInfo TObjArray
OBJ: TStreamerInfo TStreamerBase
root [4] f->GetListOfKeys()->Print()
TKey Name = CVoltage, Title = , Cycle = 1
TKey Name = CBowl, Title = , Cycle = 1
TKey Name = CCalibMass, Title = , Cycle = 1
[/ul]The file is supposed to have the following objects:
CVoltage (non-root object)
CBowl (non-root object)
CCalibMass (non-root object)
CEfficiency (non-root object)
CHits (non-root object)
CRunHeader (non-root object)
nth (a TTree object)
There are a bunch of other root objects, but not at the top level…

Thanks!

Ed,

TFile recovery is automatic (see TFile::Recover).
ROOT will try to recover as many objects/keys as possible from your file.

Rene