Hello,
I have a program which reads and modifies data stored in a directory structure. The data itself is in text files. What I would like to do is to pack everything in a single file, i.e. hide the complex directory structure from the users. I was thinking of a zip archive or a disk image.
Can anyone recommend a static ANSI C/C++ library which would allow manipulating the content of an archive or disk image?
I found zlib, but it seems that it can't handle directory structures.
I'm aiming for a cross-platform application which could be run on Amiga, Mac OS X, and Windows.
Could you not restructure your program to use an XML file?
Your current directory heirarchy could be emulated with elements in xml, and it's easily cross platform with expat or other xml handler.
Simon
@jap
There is libzip that you can use. The version currently on OS4Depot is 0.10.1 but I can update it to the latest (0.11.1) if you want.
http://os4depot.net/index.php?function=showfile&file=development/library/misc/libzip.lha
@Rigo
I would rather not. It's important that a novice can create the data using a text editor and no XML knowledge is required.
@salass00
Thanks! This is exactly what I've been looking for.
I installed the library but ran into linking problems. I'm using Rigo's CodeBench and I've added libzip.a to linker objects. When I build my project, I get these errors:
add -lz after -lzip
@jap
I've been using libzip to dip into EPUB e-book files (which are in fact ZIP-packed XML files), and the library is extremely easy to use.
@salass
An update to the library will be very welcome!
AmigaOne X5000-020 / 2GB RAM / Sapphire Pulse Radeon RX 560 / AmigaOS 4.1 Final Edition Update 2
libzip 0.11.1 is now in the OS4Depot upload queue.
@jap
As afxgroup said you also need to link also with libz as this lib is used for compression/decompression.
I can compile and link without errors now. Thanks afxgroup and salass00!