Staredit Network > Forums > Technology & Computers > Topic: C++ File Output
C++ File Output
Jan 18 2009, 9:19 pm
By: Elvang  

Jan 18 2009, 9:19 pm Elvang Post #1



I'm currently using C++ and ShadowFlare's mpq library to mess around with maps. My program currently opens the mpq, opens the chk, then writes each section to a temp file(after any editing) before finally adding it back to the mpq and compacting it.

I'm using write() with a fstream(app|out|binary) and it will output some sections correctly but others it will screw up the data (after investigation of temp file with hex editor). The documentation for fstream::write() says the output is unformatted even though it takes a char*, and I'm sending it a pointer to the buffer for each section; in the case of edited sections I send it a pointer to a structure. The temp file size is correct, though some of the data is incorrect. Scmdraft also seems to think that the resulting mpq has been protected(with and without file compression). Any hints as to what I'm doing wrong? Been messing with it on and off for a few days and I'm out of ideas.

I can attach the .cpp if needed, only ~150 lines with comments.



None.

Jan 19 2009, 4:34 am Falkoner Post #2



SCM Draft is extremely sensitive to protection, so if anything is out of the ordinary, it stops trying to read it, even though it could easily fix the problem.



None.

Jan 19 2009, 4:47 am Elvang Post #3



Staredit also refuses to open it :\



None.

Options
  Back to forum
Please log in to reply to this topic or to report it.
Members in this topic: None.
[10:13 pm]
Oh_Man -- No APM in chess. Computer just outthinks the human by seeing more moves ahead and more permutations
[10:12 pm]
Oh_Man -- U reckon? Kasparov waa defeated by computer decades ago
[05:47 pm]
NimoStar -- If its any consolation, the human brain would still mop the floor with this bot if it wasn't limited by the mechanical interface
[05:34 pm]
NimoStar -- Well. The bot didn't come up with any new strategy. It just has superhuman micro. Hard to beat that. I reckon even the simplest dedicated chess engines are unbeatable for humans now.
[02:13 pm]
Oh_Man -- all g
[10:54 am]
NudeRaider -- Oh_Man
Oh_Man shouted: NudeRaider did u watch the entire video? it's not one game. it's currently dominating the ladder at number 1 position. do ur research first!
Oops, caught me there, no I haven't. :( I was imagining how the game went. Sorry for that. Watching it now. brb
[10:52 am]
NudeRaider -- NimoStar
NimoStar shouted: They were not "Unprepared" that was their fifth loss in a row against the bot. The other replays are also available
that doesn't mean he was prepared. When humans come around with new strategies it often takes weeks until the pros figure out how to shut it down. Oh_Man that's certainly a way more convincing argument for micro being "too good to beat".
[09:43 am]
DiearAnother -- wirefram
[08:35 am]
NimoStar -- Well, pros showed that long ago... half of zerg pros just ling muta rush
[08:35 am]
NimoStar -- " its shown is that you can trade 1000's of apm to make up for lack of strategy"
Please log in to shout.


Members Online: O)FaRTy1billion[MM], Oh_Man