Skip to content

Instantly share code, notes, and snippets.

@tmcw
Created April 22, 2013 22:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tmcw/5439051 to your computer and use it in GitHub Desktop.
Save tmcw/5439051 to your computer and use it in GitHub Desktop.
var tar = require('tar'),
sax = require('sax');
process.stdin
.pipe(tar.Parse())
.on("extendedHeader", function (e) {
})
.on("ignoredEntry", function (e) {
})
.on("longLinkpath", function (e) {
})
.on("longPath", function (e) {
})
.on("entry", function (e) {
// console.error("entry", e.props);
e.on("data", function (c) {
// console.log(c):
});
e.on("end", function () {
// console.error(" <<<EOF");
});
});
import tarfile, sys
tar = tarfile.open(fileobj=sys.stdin, mode='r|')
for f in tar:
pass
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment