Reputation: 4872
I need to archive several files into one file (like a tar file does) programmatically using C++ on both Linux and Windows. It doesn't necessarily need to be a tar file, any compressed/uncompressed file format that can be used on both OS' will do. Any ideas where to look?
Upvotes: 4
Views: 10051
Reputation: 4872
libarchive is a library for Linux and Windows. It can be statically linked against in Windows, and some Linux distros have the libarchive libraries already installed
Upvotes: 2
Reputation: 34063
You can have a look at zlib. Look at the Related External Links section of that page for links to resources and dlls for compiling this on Windows.
Upvotes: 2
Reputation: 5789
Windows XP has built-in zip file handling
on *nix you can use zip
and unzip
Upvotes: 0
Reputation: 25698
If the LGPL license is ok for you take a look at http://sourceforge.net/projects/sevenzip/ I do not think that the compression part of the program is very close tied up with windows. So just get the part you need from it, it supports a lot formats: 7z, XZ, BZIP2, GZIP, TAR, ZIP, WIM, ARJ, CAB, CHM, CPIO, CramFS, DEB, DMG, FAT, HFS, ISO, LZH, LZMA, MBR, MSI, NSIS, NTFS, RAR, RPM, SquashFS, UDF, VHD, WIM, XAR, Z.
Upvotes: 2