Comparing version 0.1.8 to 0.2.0
14
index.js
@@ -124,3 +124,15 @@ var tar = require('tar-stream'); | ||
var now = new Date(); | ||
var umask = ~process.umask(); | ||
var dmode = 0; | ||
var fmode = 0; | ||
if (opts.readable) { | ||
dmode |= 0555; | ||
fmode |= 0444; | ||
} | ||
if (opts.writable) { | ||
dmode |= 0333; | ||
fmode |= 0222; | ||
} | ||
var utimesParent = function(name, cb) { // we just set the mtime on the parent dir again everytime we write an entry | ||
@@ -151,3 +163,3 @@ var top; | ||
if (!chmod) return cb(); | ||
chmod(name, header.mode, function(err) { | ||
chmod(name, (header.mode | (header.type === 'directory' ? dmode : fmode)) & umask, function(err) { | ||
if (err) return cb(err); | ||
@@ -154,0 +166,0 @@ if (!own) return cb(); |
{ | ||
"name": "tar-fs", | ||
"version": "0.1.8", | ||
"version": "0.2.0", | ||
"description": "filesystem bindings for tar-stream", | ||
@@ -5,0 +5,0 @@ "repository": "git://github.com:mafintosh/tar-fs.git", |
@@ -40,2 +40,13 @@ # tar-fs | ||
Set `options.readable` and `options.writable` to ensure that files extracted are readable and/or writable | ||
``` js | ||
var extract = tar.extract('./my-directory', { | ||
readable: true, | ||
writable: true | ||
}); | ||
``` | ||
This is useful when the tarball was created on windows (which can result in dirs not being readable) | ||
## Copy a directory | ||
@@ -42,0 +53,0 @@ |
10174
244
70