How to access native extension resource files within the extension? (SOLVED)

I created a native extension with a custom resource file(it is a text file - ca.pem). I placed it in subfolder res/common as the instructions of native extension manual so that it can be shared across all platforms. But when I tried to read it from c source file with open(“ca.pem”) function, the open operation failed due to “No such file or directory”. I am not sure what path should be used in this case, is it platform related? BTW, I am using macOS in debugging.

First of all you have to bundle your costom file using bundle_resources property in game.project

Then you need full path to the file, how to do this you can look into defos for example

3 Likes

Thanks @AGulev for the reply.

1 Like