Page 1 of 1
Writing to files
Posted: Mon Jul 17, 2006 4:14 am
by WedNESday
I want to create save states and RAM dumps etc. But when I use _write (C++) and $0D, $0A are next to each other then it looks like this $0D, $0A, $00 $00 $00 $00 $00 $00. Here is an example of my code;
Code: Select all
int handle = _open("mem.dmp", _O_BINARY | _O_WRONLY);
WriteData();
_write(handle, Buffer, i);
_close(handle);
Posted: Mon Jul 17, 2006 7:38 am
by Quietust
Err, is there a reason why you aren't using fopen/fwrite/fclose instead (or, since you're using C++, fstream)? The _open/_write/_close method is, as I understand it, somewhat antiquated.
Posted: Mon Jul 17, 2006 3:19 pm
by WedNESday
Why do I don a big novelty moustache and drive a 1975 Gran Torino? Is it because I am a Starsky and Hutch fan? Or because I am a nutter? Neither, actually. I am just fond of the 70's. You know the good old days. Same goes for my _open. I'm also a lazy *** ** ******** ******er, and cannot be bothered to read up on fopen. It doesn't matter anymore because I have solved the problem now. Thanks.