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:03 pm]
IskatuMesk -- no Hello World? No Hello . jpeg? Not even ddosing some government website? smh my head
[2026-5-31. : 10:02 pm]
Symmetry -- I was really just figuring out how to compile
[2026-5-31. : 10:02 pm]
Symmetry -- I didn't make it do anything
[2026-5-31. : 9:17 pm]
Ultraviolet -- hell yeah. did you have trouble making the button functional, or just haven't gotten there yet?
[2026-5-31. : 8:29 pm]
Symmetry -- I made the marine shoot lasers and gave the medic a nonfunctional button
[2026-5-31. : 8:07 pm]
Ultraviolet -- Symmetry
Symmetry shouted: I did my first EUD thing today. Feels like me finding arsenal at age 8 again
haha for sure. in some ways it's even more exciting because you can play EUD maps on regular battle.net, don't need to convince someone to download your mod to play with you. what did you do?
[2026-5-31. : 6:47 pm]
Symmetry -- I did my first EUD thing today. Feels like me finding arsenal at age 8 again
[2026-5-31. : 3:20 pm]
l)ark_ssj9kevin -- le reddit
[2026-5-31. : 2:55 pm]
Moose -- >reddit :rip2:
[2026-5-31. : 2:07 pm]
IskatuMesk -- reddit 💀
Please log in to shout.


Members Online: RIVE