brendan-duncan / archive

Dart library to encode and decode various archive and compression formats, such as Zip, Tar, GZip, ZLib, and BZip2.
MIT License
399 stars 139 forks source link

how to decode .tgz file? #258

Open wengxianxun opened 1 year ago

wengxianxun commented 1 year ago

how to decode .tgz file

brendan-duncan commented 1 year ago

.tgz is the same thing as .tar.gz. So, decode the gzip, then decode the tar.

Or you can use the tar_command extractFiles convenience function:

import 'package:archive/src/tar/tar_command.dart' as tar;
//...
string inputFilePath = 'file.tgz';
string outputPath = 'path_to_write_files';

tar.extractFiles(inputFilePath, outputPath);