However neither of these methods seem to work and I don't want to have to resort to using C++ File Streams. Can anyone explain step by step if possible how to create and then write to file using Irrlicht?
I could be mistaken, but it looks like you are not very familliar with C/C++ and pointers... You need to initialize the file pointer to refer to a file instance.
//// assuming that Device is the pointer returned by createDevice()
//// you can replace my constants with variables, but you need to
//// make sure you initialize each of the pointers...
// get a pointer to the file system
IFileSystem* FileSystem = Device->getFileSystem();
// ask the file system for a pointer to a writable file
IWriteFile* File = FileSystem->createAndWriteFile("blah.txt", false);
if (File)
{
// write 4 characters to that file
File->write("blah", 4);
// destroy the file instance, which should flush the file to disk
File->drop();
}
Well, I know that the code I pasted above works. I tested it before posting.
Of course it would help us all if you could explain what happens when you try to write a file with your original code. Does it compile, link, crash, write the file, write garbage, ???