int FileOpenAsset(char *filename);


Open a file asset that will be shipped with your product.


Return Value


Returns an int handle to the resource file opened.





Name of the file to be opened.


NOTE: The file system used by iOS is case sensitive, so be sure to match the case of the file name in your code to that of the file on your computer.




FileOpenAsset() will open an existing file in the folder where your application assets reside (the folder Assets which resides in the same directory as your executable).  These may be game data or table files that are read only and are shipped along with your game.  Typically, these files are in the Debug folder (on Windows, using Visual C++) where your application resides.  In specifying the path to the file to be opened, omit the Assets portion of the path.  DragonFireSDK will only load files from locations relative to the Assets folder.




Available in DragonFireSDK 1.0 and later.




The example below tests for an existing file on the first run of the app and if the file does not exist, it opens the shipped file from Assets and saves a writable copy to the Documents folder.


#include "DragonFireSDK.h"


int MyFile;

int MyNewFile;

char MyFileBuffer[200];


void AppMain()





  if (!MyFile)



       FileRead(MyFile, MyFileBuffer, 200);


       FileWrite(MyNewFile, MyFileBuffer, 200);





       FileRead(MyFile, MyFileBuffer, 200);



  if (MyFile)




void OnTimer()





void AppExit()