# File path location - Absolute working, relative not

**URL:** <https://forums.unrealengine.com/t/file-path-location-absolute-working-relative-not/340005>\
**Category:** Blueprint\
**Tags:** unreal-engine, xml, UE4, CPP, Blueprint, question\
**Created:** [November 29, 2015, 6:31am UTC](https://forums.unrealengine.com/t/file-path-location-absolute-working-relative-not/340005 "2015-11-29T06:31:29Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jiyko](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Jiyko](https://forums.unrealengine.com/u/Jiyko)\
**Post date:** [November 29, 2015, 6:31am UTC](https://forums.unrealengine.com/t/file-path-location-absolute-working-relative-not/340005/1 "2015-11-29T06:31:29Z")

</div>

I am trying to read an XML file at runtime. The file loads perfectly when I use the absolute file address but not when I want to use a relative address.

File is being read in C++, a button press in blueprints kicks off the process.

 ![68590-vs+info.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/a/7/d/a7de7ec369aed210bfac08b36ab42fe1914d3e70.png)

What relative path should I be using? Am I missing somewhere that the file should be packaged in?

Sorry if this is a duplicate questions. Search for anything with the word relative here brings up irrelevant content.

---

<div class="post-metadata">

**Author:** ![Begounet](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Begounet](https://forums.unrealengine.com/u/Begounet)\
**Post date:** [November 29, 2015, 11:46am UTC](https://forums.unrealengine.com/t/file-path-location-absolute-working-relative-not/340005/2 "2015-11-29T11:46:05Z")

</div>

You will probably have to use the path /Game/XML/TraitsXML.xml. /Game representing your Contents directory.

Edit : It seems a little more complicated in facts… : [https://answers.unrealengine.com/questions/78360/adding-flat-file-as-asset.html](https://answers.unrealengine.com/questions/78360/adding-flat-file-as-asset.html)

---

<div class="post-metadata">

**Author:** ![Jiyko](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Jiyko](https://forums.unrealengine.com/u/Jiyko)\
**Post date:** [November 29, 2015, 6:51pm UTC](https://forums.unrealengine.com/t/file-path-location-absolute-working-relative-not/340005/3 "2015-11-29T18:51:11Z")

</div>

Ugh, that’s a little more work than I’m willing to put into a weekend side project. I might just convert it to a CSV and put it in a data table.  
Will pay around with it a bit more.

---

<div class="post-metadata">

**Author:** ![Jiyko](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Jiyko](https://forums.unrealengine.com/u/Jiyko)\
**Post date:** [December 1, 2015, 7:32pm UTC](https://forums.unrealengine.com/t/file-path-location-absolute-working-relative-not/340005/4 "2015-12-01T19:32:04Z")

</div>

Yea, ended up cutting the Run-time functionality and cooking the content in as DataTable. For the brave and crazy future devs trying to do the same thing and can’t cut the feature see here:

[https://answers.unrealengine.com/questions/78360/adding-flat-file-as-asset.html](https://answers.unrealengine.com/questions/78360/adding-flat-file-as-asset.html)

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_b4c9ac1d1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_b4c9ac1d1](https://forums.unrealengine.com/u/anonymous_user_b4c9ac1d1)\
**Post date:** [September 13, 2018, 11:33pm UTC](https://forums.unrealengine.com/t/file-path-location-absolute-working-relative-not/340005/5 "2018-09-13T23:33:51Z")

</div>

You might be able to do something like `include Runtime/Core/Public/HAL/FileManagerGeneric.h``GetLowLevel().GetFilenameOnDisk("file")`. Never tried it though.
