By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,497 Members | 1,287 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,497 IT Pros & Developers. It's quick & easy.

How to extract my file ?

P: 80
i got a program that creates a file then adds a file on top of that file so how would i go on and extract this file? here is my code.
Jan 12 '11 #1
Share this Question
Share on Google+
5 Replies


Banfa
Expert Mod 5K+
P: 8,964
You are not writing enough information into your archive file to be able to extract the files again afterwards.

At the very least you need to record somewhere where the end (or beginning) of each file is so that you can find them again to extract the right bit.
Jan 12 '11 #2

P: 80
yeah thats the problem i have i dont have a clue where to start
Jan 12 '11 #3

Banfa
Expert Mod 5K+
P: 8,964
You could do something as simple as get the size of the file first and write that to the archive before you write the file itself. Then the archive would contain a list of size then data then size then data etc and you could easily skip through to extract the second or third file if you wanted.

You could go further and store the name of the file as well.
Jan 12 '11 #4

P: 80
its easily said then done, file archiver not a gd thing for a novice programmer to start on
Jan 12 '11 #5

weaknessforcats
Expert Mod 5K+
P: 9,197
Have you got a design on paper? It's kinda hard to just start coding when you have no roadmap.
Jan 12 '11 #6

Post your reply

Sign in to post your reply or Sign up for a free account.