-
February 13th, 2006, 04:38 PM
#1
Senior Member
Delete block from file
Hi to all,
I have a simple problem (question) about C++. I use Windows API functions ReadFile and Write file to "hide" one file in another and then to extract this file. My question is how can I delete the "hidden" file which is exactly a block in the other file? I'm using WindowsXP and Borland C++ Builder 6.0 if this can help.
P.S. If somebody want I can post the source if the program.
-
February 13th, 2006, 05:01 PM
#2
Read block.. If block == your inserted data skip next step.. Write block.. repeat until end-of-file.
Oliver's Law:
Experience is something you don't get until just after you need it.
-
February 13th, 2006, 07:37 PM
#3
Senior Member
Hi,
I didn't understand your solution. Could you explain ...
10x
-
February 15th, 2006, 08:56 PM
#4
Senior Member
Hellooo,
anybody there ... anybody can help me ?
-
February 16th, 2006, 01:14 AM
#5
Read up until the block you want to delete, then skip that block, then read and write till EOF, then truncate the file to the new size. Not sure how to do that in windows, so I hope you are.
-
May 29th, 2006, 05:54 PM
#6
How is the one file 'hidden' in the other? You could, for example, maybe like
Read up until the hidden file. Remember where that point in the file is. Read the hidden file into a buffer. Then read the rest of the file into another buffer. Then seek back to the point where the hidden file was, write the rest of the file buffer to that place, and set the EOF after it.
Edit: If you just don't know the API's and didn't need conceptual stuff I can list those
-
May 30th, 2006, 05:40 AM
#7
Tonto, Just a heads up but if you notice the date on this thread is flashing which prolly means the user got his/her answer by now. Please take a look at the AO FAQ and enjoy your stay here!
-
May 31st, 2006, 12:16 AM
#8
Sorry about that. Didn't realize that a lot of these threads are pretty old.
-
May 31st, 2006, 12:18 AM
#9
Its no prob I was just giving you the heads up so you dont start your time off here in the red by getting negged when you dont have too.
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
|
|