How to get external file with Fpaths?

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 :smiley: noob c++

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


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 :smiley: thanks for reply

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.

ohh ok :smiley: 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 :stuck_out_tongue: 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 :smiley: but i know is the only choice :smiley: thanks for the reply