I was trying to integrate an FIT SDK into game I was working on. I got SDK of FIT as C++ and I wanted to create a file using fstream in Unreal. But, it was failed.
So, I created a file in Unreal using
FFileHelper::SaveStringToFile(TEXT(""), *path);
Then, I tried to access the file using ios::fstream
But, I can’t able to access it. As file has been created successfully in the UE4.
But, when I tried to access the file from the file location after packaging. (Android ) it was not working as expected.
Can you please post your path ? because I think that the problem is there.
Also the method FFileHelper::SaveStringToFile returns a bool, you can check whether you function returns true or false for the file creation.
So I tested your code by changing the path, using the Unreal Engine class FPaths to get the project directory and create the file using the same method as you and i get a success for the IF condition.
Sorry, I forgot to mention, I was facing this issue only on device(Android). I was trying to access the file. It was created in Android packaged build. But, when I try to access via fstream It was failing.