3

I'm trying to save a couple of files to a container file. The files can be modified later which means the container might have to be enlarged. The user should only see this container as a single file in the file system. The application is written in C++ and running on Windows, but the files should be portable to other platforms as well.

The requirements for the container format are:
1. Size: Allow files bigger than 4GB.
2. Portability: It should be feasible to open the container files on other platforms.
3. Performance: When changing a file inside the container, only the "chunks" that represent that specific file may be changed. Especially, there may not be a complete rewrite of that file.
4. Structure: It should provide a directory structure that allows to build a hierarchy of files and directories.

When leaving out requirement 1.) and 2.) compound files (like used by Word and Excel) are a good fit.

Of course, it's possible to design an API that fulfills all the requirements, but I wonder if there is already some open-source solution that tackles the very problem?

Any suggestions?

Andre
  • 1,577
  • 1
  • 13
  • 25

4 Answers4

2

Is the HDF5 File Format what you are looking for if you are building an application in C++

1

A google search for "portable structured storage" yielded: pole

Ferruccio
  • 98,941
  • 38
  • 226
  • 299
  • Thank you for the link, but I do not want to use compound files, just something with a similar concept. BTW, pole and pole++ both seem to be unmaintained. – Andre Dec 17 '08 at 13:25
0

Some archive format (zip, bzip2) might do the job.

jfs
  • 399,953
  • 195
  • 994
  • 1,670
0

To extend J.F. Sebastian's answer, tar might be a better format due to it not compressing. It's literally just a container.

I'm not certain how any of these archive formats are at being editable though. Have a play with SharpZipLib and find out, I guess =)

Oli
  • 235,628
  • 64
  • 220
  • 299
  • 2
    You can store files in zip format without any compression (other archive formats might also support uncompressed storage). – jfs Dec 17 '08 at 14:39