Windows programming

Moderators: None (Apply to moderate this forum)
Number of threads: 3711
Number of posts: 9173

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
Windows File Writing... Posted by Sephiroth on 8 Dec 2003 at 11:08 AM
OK, I just read on the MSDN that opening a file with "fopen()" and using the mode "a+" will not allow you to over-write data in a file. I have just made an MP3 tag editor, and I need to over-write data with it. I don't know the format of the encoded data, so I can't buffer the entire file to memory and then burst it into a new file, but I do know the EXACT locations of the data I want to modify. How can I do this?

-Sephiroth
Report
Re: Windows File Writing... Posted by AsmGuru62 on 8 Dec 2003 at 12:46 PM
This message was edited by AsmGuru62 at 2003-12-8 12:46:29

: OK, I just read on the MSDN that opening a file with "fopen()" and using the mode "a+" will not allow you to over-write data in a file. I have just made an MP3 tag editor, and I need to over-write data with it. I don't know the format of the encoded data, so I can't buffer the entire file to memory and then burst it into a new file, but I do know the EXACT locations of the data I want to modify. How can I do this?
:
: -Sephiroth
:
FILE* pFile = fopen ("any file name here", "r+b");

fseek (pFile, 1762, SEEK_SET);
// ^^^ go to exact location of 1762 bytes
// from the beginning of the file

// write a few (five symbols) bytes at this location:
fwrite ("Hello", sizeof (char), 5, pFile);
fclose (pFile);



Report
Re: Windows File Writing... Posted by Sephiroth on 8 Dec 2003 at 3:40 PM
Yeah I figured it out, but not thanks to MSDN. I have (once again) the wonder Linux MAN pages to thank. I really should just leave an SSH2 terminal open to one of my Linux-boxes 24/7 for stuff like this that M$ "forgets" to post or posts wrong. Too bad those pages don't have the Win32 GUI functions and such in them, that'd make it super-easy to find anything :D!
-Sephiroth

Report
Re: Windows File Writing... Posted by AsmGuru62 on 9 Dec 2003 at 7:43 AM
: Yeah I figured it out, but not thanks to MSDN. I have (once again) the wonder Linux MAN pages to thank. I really should just leave an SSH2 terminal open to one of my Linux-boxes 24/7 for stuff like this that M$ "forgets" to post or posts wrong. Too bad those pages don't have the Win32 GUI functions and such in them, that'd make it super-easy to find anything :D!
: -Sephiroth
:
:
Win32 GUI? No problem...

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winprog/winprog/functions_by_category.asp

I always post that link - super-easy to find whatever you need to find.

Report
Re: Windows File Writing... Posted by Sephiroth on 9 Dec 2003 at 11:16 AM
: Win32 GUI? No problem...
:
: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winprog/winprog/functions_by_category.asp
:
: I always post that link - super-easy to find whatever you need to find.
:

:
Added to favorites.

-Sephiroth

Report
Re: Windows File Writing... Posted by pingpong on 9 Dec 2003 at 3:36 PM
: Added to favorites.

Mr Open Source is using IE! ;)

Report
Re: Windows File Writing... Posted by AsmGuru62 on 10 Dec 2003 at 9:32 AM
: : Added to favorites.
:
: Mr Open Source is using IE! ;)
:
:
...erm... yeah, it is a free country... - I think, Seph has both in his cellar...
Report
Re: Windows File Writing... Posted by Sephiroth on 10 Dec 2003 at 6:52 PM
: : : Added to favorites.
: :
: : Mr Open Source is using IE! ;)
: :
: :
: ...erm... yeah, it is a free country... - I think, Seph has both in his cellar...
:
I use IE because it doesn't crash or is crappy as hell like NutScrape, and because it comes integrated into Windoze. Does all I need anyway. However, if I was a major web-guy, I'd use Opera or something. Oh wait, LONG LIVE LYNX!! If you don't get it you just don't know.

-Sephiroth




 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.