PDA

View Full Version : Unpack tar file without using the shell



robjford
December 9th, 2007, 02:15 PM
Anyone know of a library I can use with C/C++ to open a tar archive and access the files within.

I could always call system() to do the work for me, but if there's a more elegant solution, I'd like to know.

Thanks in advance.

geirha
December 9th, 2007, 03:01 PM
There's libtar. Install the libtar-dev package and read the man pages. You'll find a list of the man-pages with
dpkg -L libtar-dev

zyghom
December 9th, 2007, 03:01 PM
perl ?

http://search.cpan.org/~kane/Archive-Tar-1.36/lib/Archive/Tar.pm

DESCRIPTION

Archive::Tar provides an object oriented mechanism for handling tar files. It provides class methods for quick and easy files handling while also allowing for the creation of tar file objects for custom manipulation. If you have the IO::Zlib module installed, Archive::Tar will also support compressed or gzipped tar files.

robjford
December 9th, 2007, 06:13 PM
Many thanks, libtar looks to do the job