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?
-[italic][b][red]S[/red][purple]e[/purple][blue]p[/blue][green]h[/green][red]i[/red][purple]r[/purple][blue]o[/blue][green]t[/green][red]h[/red][/b][/italic]
Comments
: 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?
:
: -[italic][b][red]S[/red][purple]e[/purple][blue]p[/blue][green]h[/green][red]i[/red][purple]r[/purple][blue]o[/blue][green]t[/green][red]h[/red][/b][/italic]
:
[code]
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);
[/code]
-[italic][b][red]S[/red][purple]e[/purple][blue]p[/blue][green]h[/green][red]i[/red][purple]r[/purple][blue]o[/blue][green]t[/green][red]h[/red][/b][/italic]
: -[italic][b][red]S[/red][purple]e[/purple][blue]p[/blue][green]h[/green][red]i[/red][purple]r[/purple][blue]o[/blue][green]t[/green][red]h[/red][/b][/italic]
:
:
[blue]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.
[/blue]
:
: 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.
: [/blue]
:
Added to favorites.
-[italic][b][red]S[/red][purple]e[/purple][blue]p[/blue][green]h[/green][red]i[/red][purple]r[/purple][blue]o[/blue][green]t[/green][red]h[/red][/b][/italic]
Mr Open Source is using IE!
:
: Mr Open Source is using IE!
:
:
[blue]...erm... yeah, it is a free country... - I think, Seph has both in his cellar...[/blue]
: :
: : Mr Open Source is using IE!
: :
: :
: [blue]...erm... yeah, it is a free country... - I think, Seph has both in his cellar...[/blue]
:
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.
-[italic][b][red]S[/red][purple]e[/purple][blue]p[/blue][green]h[/green][red]i[/red][purple]r[/purple][blue]o[/blue][green]t[/green][red]h[/red][/b][/italic]