| 1011 | } |
| 1012 | |
| 1013 | TFile Duplicate() const { |
| 1014 | TFileHandle dupH(Handle_.Duplicate()); |
| 1015 | if (!dupH.IsOpen()) { |
| 1016 | ythrow TFileError() << "can't duplicate the handle of " << FileName_.Quote(); |
| 1017 | } |
| 1018 | TFile res(dupH); |
| 1019 | dupH.Release(); |
| 1020 | return res; |
| 1021 | } |
| 1022 | |
| 1023 | // Maximum amount of bytes to be read via single system call. |
| 1024 | // Some libraries fail when it is greater than max int. |