]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - RAW/AliRawCastorDB.cxx
Updates to RAW package. Used during the Computing DC.
[u/mrichter/AliRoot.git] / RAW / AliRawCastorDB.cxx
index f57921b0f8592d8d6486e37b9629e09771197578..9f81676af90608664ecacba40608b230d4ae92bc 100644 (file)
@@ -103,21 +103,29 @@ const char *AliRawCastorDB::GetFileName() const
 }
 
 //______________________________________________________________________________
-void AliRawCastorDB::Close()
+Int_t AliRawCastorDB::Close()
 {
    // Close raw CASTOR/rootd DB.
 
-   if (!fRawDB) return;
+   if (!fRawDB) return 0;
+
+   if (!fRawDB->IsOpen()) return 0;
 
    fRawDB->cd();
 
    // Write the tree.
-   fTree->Write();
-   if (fESDTree) fESDTree->Write();
+   Bool_t error = kFALSE;
+   if (fTree->Write() == 0)
+     error = kTRUE;
+   if (fESDTree)
+     if (fESDTree->Write() == 0)
+       error = kTRUE;
 
    // Close DB, this also deletes the fTree
    fRawDB->Close();
 
+   Int_t filesize = fRawDB->GetEND();
+
    if (fDeleteFiles) {
       TUrl u(fRawDB->GetName());
       gSystem->Exec(Form("rfrm %s", u.GetFile()));
@@ -125,4 +133,9 @@ void AliRawCastorDB::Close()
 
    delete fRawDB;
    fRawDB = 0;
+
+   if(!error)
+     return filesize;
+   else
+     return -1;
 }