better type support
This commit is contained in:
parent
1328813c86
commit
aec83fd34e
2 changed files with 17 additions and 7 deletions
|
@ -65,9 +65,11 @@ Most of these values can be found by stating a file.
|
||||||
name: 'path/to/this/entry.txt',
|
name: 'path/to/this/entry.txt',
|
||||||
size: 1314, // entry size. defaults to 0
|
size: 1314, // entry size. defaults to 0
|
||||||
mode: 0644, // entry mode. defaults to to 0755 for dirs and 0644 otherwise
|
mode: 0644, // entry mode. defaults to to 0755 for dirs and 0644 otherwise
|
||||||
mtime: new Date(), // last modified date for entry
|
mtime: new Date(), // last modified date for entry. defaults to now.
|
||||||
type: 'file', // type of entry. can be file|directory|link|block|character|fifo
|
type: 'file', // type of entry. defaults to file. can be:
|
||||||
linkname: 'path', //
|
// file | link | symlink | directory | block-device
|
||||||
|
// character-device | fifo | contigious-file
|
||||||
|
linkname: 'path', // linked file name
|
||||||
uid: 0, // uid of entry owner. defaults to 0
|
uid: 0, // uid of entry owner. defaults to 0
|
||||||
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
|
||||||
|
|
16
headers.js
16
headers.js
|
@ -6,14 +6,18 @@ var toType = function(flag) {
|
||||||
switch (flag) {
|
switch (flag) {
|
||||||
case 1:
|
case 1:
|
||||||
return 'link';
|
return 'link';
|
||||||
|
case 2:
|
||||||
|
return 'symlink';
|
||||||
case 3:
|
case 3:
|
||||||
return 'character';
|
return 'character-device';
|
||||||
case 4:
|
case 4:
|
||||||
return 'block';
|
return 'block-device';
|
||||||
case 5:
|
case 5:
|
||||||
return 'directory';
|
return 'directory';
|
||||||
case 6:
|
case 6:
|
||||||
return 'fifo';
|
return 'fifo';
|
||||||
|
case 7:
|
||||||
|
return 'contiguous-file'
|
||||||
}
|
}
|
||||||
return 'file';
|
return 'file';
|
||||||
};
|
};
|
||||||
|
@ -22,14 +26,18 @@ var toTypeflag = function(flag) {
|
||||||
switch (flag) {
|
switch (flag) {
|
||||||
case 'link':
|
case 'link':
|
||||||
return 1;
|
return 1;
|
||||||
case 'character':
|
case 'symlink':
|
||||||
|
return 2;
|
||||||
|
case 'character-device':
|
||||||
return 3;
|
return 3;
|
||||||
case 'block':
|
case 'block-device':
|
||||||
return 4;
|
return 4;
|
||||||
case 'directory':
|
case 'directory':
|
||||||
return 5;
|
return 5;
|
||||||
case 'fifo':
|
case 'fifo':
|
||||||
return 6;
|
return 6;
|
||||||
|
case 'contiguous-file':
|
||||||
|
return 7;
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
Loading…
Reference in a new issue