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.
[04:25 pm]
l)ark_ssj9kevin -- oh wow it's kind of like archipeligo but solo
[09:43 am]
Oh_Man -- makes me wonder tho, a brood war achievement project culd be quite something, following the design methodology of SC2 achieves
[09:43 am]
Oh_Man -- intresting concept, i see starcraft N64 is on there, most of the achieves seen bare bones though
[09:43 am]
Oh_Man -- https://retroachievements.org/ i stumbled across this website
[2026-7-02. : 9:57 pm]
IskatuMesk -- :wob:
[2026-7-02. : 10:46 am]
UndeadStar -- :wob:
[2026-7-01. : 3:34 pm]
Symmetry -- :wob:
[2026-7-01. : 4:42 am]
Zycorax -- :wob:
[2026-6-30. : 6:38 pm]
Ultraviolet -- :wob:
[2026-6-29. : 2:13 pm]
Vrael -- pee poo sibling
Please log in to shout.


Members Online: Moose