# A problem about opening a file

**URL:** <https://root-forum.cern.ch/t/a-problem-about-opening-a-file/38733>\
**Category:** Newbie\
**Created:** [April 6, 2020, 8:40am UTC](https://root-forum.cern.ch/t/a-problem-about-opening-a-file/38733 "2020-04-06T08:40:50Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![11122](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/1/6a8cbe/32.png) [@11122](https://root-forum.cern.ch/u/11122)\
**Post date:** [April 6, 2020, 8:40am UTC](https://root-forum.cern.ch/t/a-problem-about-opening-a-file/38733/1 "2020-04-06T08:40:50Z")

</div>

Hi  
I use ‘’‘TFile \*f = new TFile(“3pietap\_Sig\_ppg\_mcs\_nophotoncut\_pipipietap.root”);’’’ in my macros and then I take this file to the folder where I install root ,but when I excute this macros,root shows that this file is not existed,so could you tell me where the problem is?  
thanks

* * *

_Please read [tips for efficient and successful posting](https://root-forum.cern.ch/t/tips-for-efficient-and-successful-posting/28292) and [posting code](https://root-forum.cern.ch/t/posting-code-read-this-first/28293)_

_ROOT Version:_ 6.18.04  
_Platform:_ windows10  
_Compiler:_ Not Provided

* * *

---

<div class="post-metadata">

**Author:** ![couet](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/couet/32/12037_2.png) [@couet](https://root-forum.cern.ch/u/couet)\
**Post date:** [April 6, 2020, 8:52am UTC](https://root-forum.cern.ch/t/a-problem-about-opening-a-file/38733/2 "2020-04-06T08:52:28Z")

</div>

You should put this file in the folder where you are running ROOT when in the folder where you installed ROOT.

---

<div class="post-metadata">

**Author:** ![11122](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/1/6a8cbe/32.png) [@11122](https://root-forum.cern.ch/u/11122)\
**Post date:** [April 6, 2020, 9:15am UTC](https://root-forum.cern.ch/t/a-problem-about-opening-a-file/38733/3 "2020-04-06T09:15:15Z")

</div>

Do you mean I should put the file in root\_v6.18.04/bin?

---

<div class="post-metadata">

**Author:** ![couet](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/couet/32/12037_2.png) [@couet](https://root-forum.cern.ch/u/couet)\
**Post date:** [April 6, 2020, 9:35am UTC](https://root-forum.cern.ch/t/a-problem-about-opening-a-file/38733/4 "2020-04-06T09:35:26Z")

</div>

If you do:

```auto
TFile *f = new TFile(“3pietap_Sig_ppg_mcs_nophotoncut_pipipietap.root”);’

```

The file should be in the directory where you start ROOT from.

You can also put the file elsewhere and specify the full path in the command above.

---

<div class="post-metadata">

**Author:** ![11122](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/1/6a8cbe/32.png) [@11122](https://root-forum.cern.ch/u/11122)\
**Post date:** [April 6, 2020, 9:40am UTC](https://root-forum.cern.ch/t/a-problem-about-opening-a-file/38733/5 "2020-04-06T09:40:23Z")

</div>

I start ROOT from rootv6.18.04/bin by x86 native tool command prompt,but I put the file in root/bin,ROOT also shows it not exists,but the second way works,thank you a lot.

---

<div class="post-metadata">

**Author:** ![11122](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/1/6a8cbe/32.png) [@11122](https://root-forum.cern.ch/u/11122)\
**Post date:** [April 6, 2020, 9:41am UTC](https://root-forum.cern.ch/t/a-problem-about-opening-a-file/38733/6 "2020-04-06T09:41:32Z")

</div>

root/bin means rootv6.18.04/bin
