as I know, if there are some files should be inclued when Packaging, “Additional Non-asset Directories to Package” should be checked. even I check this setting, fopen still read file failed.
The files are packaged so you cannot use low-level fopen to access them. You need to use the file system. The easiest way is to use LoadFileToString(), for example:
FString Contents;
FString Filename = FPaths::GameContentDir() + TEXT("Resource/conf/role/Role.conf");
if (FFileHelper::LoadFileToString(Contents, *Filename))
{
// do something with Contents
}
You can look at the code for LoadFileToString() in Engine/Source/Runtime/Core/Private/Misc/CoreMisc.cpp to see how it works.