Got a theory for a logging mechanism that logs data to file repeatedly.
More specifically, positions of a specified player.
Now, I hear tell that fileObject::openForWrite/Read/Append are very laggy methods and should be used sparingly.
Here's my theory:
new fileObject("test");
test.openForAppend("targetfile.txt");
now pause and wait for data to be written. perhaps a schedule loop, or some other method for writing data.
test.writeLine("blah data here");
Never close the fileobject until, say, the target leaves or some other event occurs.
Now, here's my question: What if the server crashes?
Will the file become corrupted?
Will it simply run the same as calling test.close();?
anyone? I presume the file will simply close then that's that, and that's what I heard, but I would like confirmation.