# How to get external file with Fpaths?

**URL:** <https://forums.unrealengine.com/t/how-to-get-external-file-with-fpaths/436798>\
**Category:** Programming & Scripting\
**Tags:** unreal-engine\
**Created:** [October 31, 2018, 11:49pm UTC](https://forums.unrealengine.com/t/how-to-get-external-file-with-fpaths/436798 "2018-10-31T23:49:38Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![EliteTech](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@EliteTech](https://forums.unrealengine.com/u/EliteTech)\
**Post date:** [October 31, 2018, 11:49pm UTC](https://forums.unrealengine.com/t/how-to-get-external-file-with-fpaths/436798/1 "2018-10-31T23:49:38Z")

</div>

bool URWTxtFile::LoadTxt(FString FileNameA, FString& SaveTextA)  
{  
return FFileHelper::LoadFileToString(SaveTextA, \*(FPaths::GameDir() + FileNameA));  
}

bool URWTxtFile::SaveTxt(FString SaveTextB, FString FileNameB)  
{  
return FFileHelper::SaveStringToFile(SaveTextB, \*(FPaths::GameDir() + FileNameB));  
}

hello looking for a solutions how can i change the locations so i can get my file from e:/drive/temp/text/textfile.txt not the same folder as the gamedir folders can i change anything on the Fpaths thanks in advance 😃 noob c++

---

<div class="post-metadata">

**Author:** ![TestyRabbit](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@TestyRabbit](https://forums.unrealengine.com/u/TestyRabbit)\
**Post date:** [November 1, 2018, 4:16am UTC](https://forums.unrealengine.com/t/how-to-get-external-file-with-fpaths/436798/2 "2018-11-01T04:16:57Z")

</div>

Have you tried just using `e:/drive/temp/text/textfile.txt` as the path you want to write to? That should work.

-Testy

---

<div class="post-metadata">

**Author:** ![EliteTech](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@EliteTech](https://forums.unrealengine.com/u/EliteTech)\
**Post date:** [November 4, 2018, 6:15pm UTC](https://forums.unrealengine.com/t/how-to-get-external-file-with-fpaths/436798/3 "2018-11-04T18:15:58Z")

</div>

yea is a blueprint function is only seaching in GameDir found another way around but still really wanna to change it to AsolutDir so i can call any txt file on my pc but still dont know how iam really new for this c++ coding 😃 thanks for reply

---

<div class="post-metadata">

**Author:** ![TestyRabbit](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@TestyRabbit](https://forums.unrealengine.com/u/TestyRabbit)\
**Post date:** [November 4, 2018, 6:49pm UTC](https://forums.unrealengine.com/t/how-to-get-external-file-with-fpaths/436798/4 "2018-11-04T18:49:41Z")

</div>

So if you’re trying to get a file from your computer in C++, you should be able to write something like this:  
`FFileHelper::LoadFileToString(SaveTextA, *"e:/drive/temp/text/textfile.txt";)`  
And just get the file directly, instead of using `FPaths`. The point of `FPaths` is to help you get files from common places on any computer, regardless of installation location. If you know your file will always be at “e:/drive/temp/text/textfile.txt” then you could use what I posted above. Although you should know that using hard-coded absolute paths like that usually isn’t a good idea, especially when it is not even on the C: drive.

---

<div class="post-metadata">

**Author:** ![EliteTech](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@EliteTech](https://forums.unrealengine.com/u/EliteTech)\
**Post date:** [November 5, 2018, 2:36pm UTC](https://forums.unrealengine.com/t/how-to-get-external-file-with-fpaths/436798/5 "2018-11-05T14:36:21Z")

</div>

ohh ok 😃 thanks i c so the best solutions is too keep everything under the same gamedir it make sense. was hoping for an easy fix on that fpaths 😛 but i found another solutions victory plugins works like magic so i just take a step back from c++ really make no sense for me :S iam 3d graphic designer sadly cant handle the coding 😃 but i know is the only choice 😃 thanks for the reply
