isaacs/node-tar — Issue #6: github-generated tar files
Author: jrburke
Created: 2012-02-08 20:01:00+00:00
State: open

I have trouble using this tar with a github-generated tar file. Steps:

mkdir node_modules
npm install tar
curl https://nodeload.github.com/documentcloud/underscore/tarball/1.3.1 > u.tar.gz
gunzip u.tar.gz
node tartest.js u.tar

where tartest.js looks like:

```javascript

var fs = require('fs'),
extract = require('tar').Extract,
path = require('path'),
fullpath = path.resolve(process.argv[1]);

console.log('untarring: ' + fullpath);

fs.createReadStream(fullpath)
.pipe(extract({ path: 'ust' }))
.on("error", function (err) { console.log('error: ' + err); })
.on("end", function (msg) { console.log('DONE: ' + msg); });

```

I get the following output:

error: Error: invalid tar file
error: Error: unexpected eof
DONE: undefined

However, doing a `tar -xvf u.tar` works, using OS X.

I am still new to the code and tar, so it could very well be just user error.