Hello all. I am trying to create a set of log files for a project i’m working on. Previously, I used fstream to make, write to, and close a text file. I recently moved to a new machine and have found that, for some reason, I am only able to write to existing files and am unable to make new ones. Is there a setting in unreal that would prohibit this? Or can someone help me find a workaround for making the file?
Found any solution yet???
It’s been a bit but if i remember correctly it ended up being a pathing issue. I ended up writing another function using FPaths that helped me find the root directory and whatnot for navigation
I ran across it again today. I ended up just making a file initialization function using FFileHelper
void <BlueprintFunctionLibrary>::initFile(std::string path)
{
std::string fullpath = TCHAR_TO_UTF8(*FPaths::ConvertRelativePathToFull(FPaths::ProjectDir()))+ path;
FString fpath = strToFstr(fullpath);
bool ret;
if (!FPaths::FileExists(*fpath))
{
ret = FFileHelper::SaveStringToFile(strToFstr(""), *fpath, FFileHelper::EEncodingOptions::AutoDetect, &IFileManager::Get(), EFileWrite::FILEWRITE_None);
}
else
{
//UELog("initFile(): " + path + " exists");
}
}