Click here to Skip to main content
15,885,757 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
How to append two different file formats and detach them back to its original form?
Posted
Comments
Pheonyx 28-May-14 4:47am    
I think you need to expand on your question, do you mean you want to change the extension on a file, or actually combine two files together some how?
jeffingeorge 28-May-14 4:54am    
yeah! Thats what i wanna do, i wanna combine two files together and later i wanna detach those 2 files from that combined file

1 solution

Create a new file
Add a header record identifying the first file, its type and length.
Read the file, and write it to the output.
Add a trailer record confirming the end of the file.
Repeat for any number of files.
Add en and of data record confirming no more file.
Close the output file.

Or any variation on this theme of your own design.

To split it, just reverse this process.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900