I am using the following code to read a string from a file:
auto levelData = FileUtils::getInstance()->getFileData(fileName, "r", &fileSize);
Then I make a change to the data and save it over the same file using the following code:
std::ofstream file(fileName);
file << strbuf.GetString();
file.close();
I know the saving process worked because I observe that the new data is present in the file now. However when I try to read the file again, I get the old version of the file instead of the new one. When I close the program and run it again, I finally get the new updated data. I’m guessing that FileUtils is caching my old data instead of reading the file like it does the first time I call it. Is there any way to prevent this or maybe clear the cache? I’ve already tried calling FileUtils::destroyInstance() and FileUtils->getInstance()->purgeCachesEntries(), but I’ve had no luck. Any ideas?