Packing Files

  • Thread starter Thread starter James Arnold
  • Start date Start date
J

James Arnold

I have a number of different files which I would like to combine into
one file, which can later be separated into the individual files
again. In essence, a zip archive, only without the compression. I do
not wish to use any 3rd party components.

Are there any built-in methods for achieving this? (The VB6 property
bag did something similar?).

Thank in advance.
 
I have a number of different files which I would like to combine into
one file, which can later be separated into the individual files
again. In essence, a zip archive, only without the compression. I do
not wish to use any 3rd party components.

..NET resource files can store binary data. You can then stream the data
back to disk pretty easily.

Otherwise, you could always ZIP the files up with no compression. The J#
namespace has a ZIP compression library. Or SharpZipLib (free library) is
much better.
 
.NET resource files can store binary data. You can then stream the data
back to disk pretty easily.

Otherwise, you could always ZIP the files up with no compression. The J#
namespace has a ZIP compression library. Or SharpZipLib (free library) is
much better.

I cannot use resource files as the content is generated by the program
at runtime.

My application creates a few files, which I want to pack into a single
file. This file is stored for later, where it is split back into the
originals. I would rather not have to use a zip library, with or
without compression.

I read through an article some time ago which showed how to append
files to an exe to extract later, which is the same principle - I just
do not want the exe :P Any ides without a 3rd party library?

Thanks again.
 
My application creates a few files, which I want to pack into a single
file. This file is stored for later, where it is split back into the
originals. I would rather not have to use a zip library, with or
without compression.

What's wrong with ZIP?

In that case XML? You can serialize the data to XML using B64 encoding?

I read through an article some time ago which showed how to append
files to an exe to extract later, which is the same principle - I just
do not want the exe :P Any ides without a 3rd party library?

..NET does have ZIP built in... so it's not really 3rd party (just that the
3rd party library is much better).
 
What's wrong with ZIP?

In that case XML? You can serialize the data to XML using B64 encoding?


.NET does have ZIP built in... so it's not really 3rd party (just that the
3rd party library is much better).

Using the SharpZipLib or alternatives is simply overkill.

I've ended up using a BinaryReader/Writer, which works perfectly. The
only issues I had were converting things like alpha bitmaps to byte
arrays but all sorted now using the Marshal.

Thank for the suggestions.
 
Back
Top