# TFile problems / Max TFile size?

**URL:** <https://root-forum.cern.ch/t/tfile-problems-max-tfile-size/2875>\
**Category:** ROOT\
**Created:** [January 23, 2006, 5:41pm UTC](https://root-forum.cern.ch/t/tfile-problems-max-tfile-size/2875 "2006-01-23T17:41:20Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mathias](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/m/bbe5ce/32.png) [@Mathias](https://root-forum.cern.ch/u/Mathias)\
**Post date:** [January 23, 2006, 5:41pm UTC](https://root-forum.cern.ch/t/tfile-problems-max-tfile-size/2875/1 "2006-01-23T17:41:20Z")

</div>

Hi everybody,

I’m trying to merge several root files to one big file where some cuts have already been applied. Therefore I’m creating a TChain containing the root files. Then I’m copying this chain with

```auto
TTree *cuttedcopy = chain->CopyTree(myCuts);
```

Afterwards I’m opening a file and want to write the created tree to this file with

```auto
TFile *out = new TFile(filename, "RECREATE");
cuttedcopy->Write();
out->Close();
```

Now I get different behaviours. If I just add a single file to the chain everything works perfect. But if I try to add more files to the chain I reach a point where things are getting strange. If I specify the file name as relative path, e.g. “cutted.root” I get the error  
  
SysError in TFile::TFile: file cutted.root can not be opened (Permission denied)  
   
This worked with the single file so I should have write privileges. Now if I specify the file name as absolute path, e.g. “/home/mathias/cutted.root” I just get the error that the operation was aborted.

Any ideas on that? Is there perhaps a limitation on the size of root-files? The final size of the file to be written on disk should be something like 250 MB which is not so much. I thought root could handle this. At least there should be no problems with my SuSE 9.3 and ReiserFS to handle these filesizes.

Thx for any hint,

Mathias

---

<div class="post-metadata">

**Author:** ![brun](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/b/b9e5f3/32.png) [@brun](https://root-forum.cern.ch/u/brun)\
**Post date:** [January 24, 2006, 7:51am UTC](https://root-forum.cern.ch/t/tfile-problems-max-tfile-size/2875/2 "2006-01-24T07:51:34Z")

</div>

You should create the output file before Copytree

Rene

---

<div class="post-metadata">

**Author:** ![Mathias](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/m/bbe5ce/32.png) [@Mathias](https://root-forum.cern.ch/u/Mathias)\
**Post date:** [January 24, 2006, 12:18pm UTC](https://root-forum.cern.ch/t/tfile-problems-max-tfile-size/2875/3 "2006-01-24T12:18:39Z")

</div>

Thanks, that works perfectly!
