Tom Leese
Tom Leese

Reputation: 19699

Extract a tar.xz in C/C++

I am writing a program that downloads tar.xz files from a server and extracts them in a certain place. I am struggling to find a away of extracting the tar.xz file in the certain place. I am using Qt so a more Qt-way of doing it would be useful, but I don't really mind.

Upvotes: 3

Views: 4254

Answers (1)

Aaron Digulla
Aaron Digulla

Reputation: 328644

There is no support for archives in Qt. You can either have a look at the KDE library which offers support for virtual file systems or you can use QProcess to call tar directly. Use -C <dir> (uppercase C) to specify the directory to extract to.

[EDIT] There also is libtar (BSD license).

Upvotes: 2

Related Questions