|
-
March 2nd, 2007, 04:01 AM
#1
add bytes to binary file
Hi!
how can I add a byte to the end of a binary file? Let's say i want to add a 0xFF to it?
Also, any method to append a whole .bin file to another one?
(except : system(copy /b ....) )
Thanks in advance!
radu
Please rate if it helps!
* The second mouse gets the cheese.
* Birthdays are good for you. The more you have, the longer you live.
* Always keep your words soft and sweet, just in case you have to eat them.
* Always read stuff that will make you look good if you die in the middle of it.
-
March 2nd, 2007, 04:09 AM
#2
Re: add bytes to binary file
1. MFC CFile Class:
Open with CFile::modeWrite | CFile::modeNoTruncate, call CFile::SeekToEnd, and CFile::Write.
2. Using Win 32 API:
CreateFile, SetFilePointer, WriteFile
-
March 2nd, 2007, 04:16 AM
#3
Re: add bytes to binary file
hi,
which platform and compiler you are using... ?
follow the steps
1) Open File using ............Open
2) seek to end of file (set file pointer to end of file),...... Seek()
3) write byte using.............. WriteFile()
Othere API and classes useful
Classs
CFile
API
CreateFile (),ReadFile,WriteFile , Seek...............
in C
fopen(),fread,fwrite.........
-Anant
"Devise the simplest possible solution that solves the problems"
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|