oggmonster
oggmonster

Reputation: 4872

Cross platform file archiving

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

Answers (5)

oggmonster
oggmonster

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

CharlesB
CharlesB

Reputation: 90396

See MiniZip library, a pure C++ cross platform Windows/linux.

Upvotes: 3

arunkumar
arunkumar

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

Victor Parmar
Victor Parmar

Reputation: 5789

Windows XP has built-in zip file handling

on *nix you can use zip and unzip

Upvotes: 0

floriank
floriank

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

Related Questions