How to Read Objects from a File


There are two ways to read an object from a file.

What happens if your job crashes while you write a file?

In case a program does not terminate in a clean way, the file directory is may be not written at the end of the file. Next time you use the file, ROOT will automatically detect this situation and will recover the directory by scanning sequentially the list of keys in the file. If the file has been opened in UPDATE mode, the recovered directory will be automatically written to the file. This automatic recovery procedure is possible because of redundant information written to the file. In case you write large TTrees, you may have large buffers in memory. In case of a job crash, you may loose a lot of data. A mechanism has been foreseen for this case. See TTree::AutoSave.


Rene Brun, Fons Rademakers
Last update 12/01/97 by Rene Brun