devmajor/devminor header entry
This commit is contained in:
parent
c228622c29
commit
52af22db8d
2 changed files with 9 additions and 3 deletions
|
@ -72,6 +72,8 @@ Most of these values can be found by stating a file.
|
||||||
gid: 0, // gid of entry owner. defaults to 0
|
gid: 0, // gid of entry owner. defaults to 0
|
||||||
uname: 'maf', // uname of entry owner. defaults to null
|
uname: 'maf', // uname of entry owner. defaults to null
|
||||||
gname: 'staff', // gname of entry owner. defaults to null
|
gname: 'staff', // gname of entry owner. defaults to null
|
||||||
|
devmajor: 0, // device major version. defaults to 0
|
||||||
|
devminor: 0 // device minor version. defaults to 0
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
10
headers.js
10
headers.js
|
@ -95,8 +95,8 @@ exports.encode = function(opts) {
|
||||||
buf.write(USTAR, 257);
|
buf.write(USTAR, 257);
|
||||||
if (opts.uname) buf.write(opts.uname, 265);
|
if (opts.uname) buf.write(opts.uname, 265);
|
||||||
if (opts.gname) buf.write(opts.gname, 297);
|
if (opts.gname) buf.write(opts.gname, 297);
|
||||||
buf.write(encodeOct(0, 6), 329);
|
buf.write(encodeOct(opts.devmajor || 0, 6), 329);
|
||||||
buf.write(encodeOct(0, 6), 337);
|
buf.write(encodeOct(opts.devminor || 0, 6), 337);
|
||||||
|
|
||||||
if (prefix) buf.write(prefix, 345);
|
if (prefix) buf.write(prefix, 345);
|
||||||
|
|
||||||
|
@ -116,6 +116,8 @@ exports.decode = function(buf) {
|
||||||
var linkname = buf[157] === 0 ? null : decodeStr(buf, 157);
|
var linkname = buf[157] === 0 ? null : decodeStr(buf, 157);
|
||||||
var uname = decodeStr(buf, 265);
|
var uname = decodeStr(buf, 265);
|
||||||
var gname = decodeStr(buf, 297);
|
var gname = decodeStr(buf, 297);
|
||||||
|
var devmajor = decodeOct(buf, 329);
|
||||||
|
var devminor = decodeOct(buf, 337);
|
||||||
|
|
||||||
if (buf[345]) name = decodeStr(buf, 345)+'/'+name;
|
if (buf[345]) name = decodeStr(buf, 345)+'/'+name;
|
||||||
|
|
||||||
|
@ -131,6 +133,8 @@ exports.decode = function(buf) {
|
||||||
type: toType(typeflag),
|
type: toType(typeflag),
|
||||||
linkname: linkname,
|
linkname: linkname,
|
||||||
uname: uname,
|
uname: uname,
|
||||||
gname: gname
|
gname: gname,
|
||||||
|
devmajor: devmajor,
|
||||||
|
devminor: devminor
|
||||||
};
|
};
|
||||||
};
|
};
|
Loading…
Reference in a new issue