It is currently Sat Dec 15, 2018 10:48 pm

All times are UTC - 7 hours





Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: Writing to files
PostPosted: Mon Jul 17, 2006 4:14 am 
Offline

Joined: Thu Sep 15, 2005 9:23 am
Posts: 1213
Location: Berlin, Germany
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:
int handle = _open("mem.dmp", _O_BINARY | _O_WRONLY);

WriteData();

_write(handle, Buffer, i);
_close(handle);


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jul 17, 2006 7:38 am 
Offline
User avatar

Joined: Sun Sep 19, 2004 10:59 pm
Posts: 1440
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.

_________________
Quietust, QMT Productions
P.S. If you don't get this note, let me know and I'll write you another.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jul 17, 2006 3:19 pm 
Offline

Joined: Thu Sep 15, 2005 9:23 am
Posts: 1213
Location: Berlin, Germany
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.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC - 7 hours


Who is online

Users browsing this forum: Nicole and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group