Sample code for 30+ languages & platforms
C

UnGzip .tgz to get a .tar

See more Tar Archive Examples

A .tgz is simply a TAR archive compressed using GZip. It is also commonly referred to as a .tar.gz. Chilkat GZip can be used to ungzip to get an uncompressed .tar.

Chilkat C Downloads

C
#include <C_CkGzip.h>

void ChilkatSample(void)
    {
    BOOL success;
    HCkGzip gzip;

    success = FALSE;

    gzip = CkGzip_Create();

    success = CkGzip_UncompressFile(gzip,"qa_data/tar/test.tgz","qa_output/test.tar");
    if (success != TRUE) {
        printf("%s\n",CkGzip_lastErrorText(gzip));
    }
    else {
        printf("success.\n");
    }



    CkGzip_Dispose(gzip);

    }