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.
[03:02 am]
Ultraviolet -- I'm gonna send inf to have sex with their moms
[03:02 am]
Ultraviolet -- fuck those motherfuckers
[11:02 pm]
NudeRaider -- PSA: ASUS apparently decided their RMA department needs to "become profitable" and for a while now outright tries to scam customers. They were called out on it a year ago, promised to change, but didn't. https://www.youtube.com/watch?v=7pMrssIrKcY so my recommendation: Stop buying ASUS, and if you already have and need something RMA'd, make sure to not let them bully you into paying.
[03:08 pm]
Oh_Man -- example of wat u mean?
[2024-5-15. : 5:59 am]
NudeRaider -- *is
[2024-5-15. : 5:17 am]
NudeRaider -- despite all its flaws the sound design its fantastic
[2024-5-14. : 10:29 pm]
Oh_Man -- homeworld 3 = massive disappointment
[2024-5-14. : 10:05 am]
Moose -- ya
[2024-5-14. : 5:23 am]
zsnakezz -- yes
[2024-5-12. : 8:51 pm]
l)ark_ssj9kevin -- Are you excited for Homeworld 3?
Please log in to shout.


Members Online: Roy, 5miae7791ga5, 7avac6691rh7