Add file type to stats.

This commit is contained in:
Alan Kligman 2013-07-26 11:59:32 -04:00
parent e690ed5292
commit 984db2ceba
3 changed files with 5 additions and 3 deletions

View File

@ -37,9 +37,9 @@ fs.open('/myfile', 'w+', function(error, fd) {
fs.link('/myfile', '/myotherfile', function(error) { fs.link('/myfile', '/myotherfile', function(error) {
if(error) throw error; if(error) throw error;
console.log('linked'); console.log('linked');
fs.unlink('/myfile', function(error) { fs.stat('/myfile', function(error, stats) {
if(error) throw error; if(error) throw error;
console.log('unlinked'); console.log(stats);
}); });
}); });
}); });

View File

@ -950,7 +950,8 @@ define(function(require) {
nlinks: result.nlinks, nlinks: result.nlinks,
atime: result.atime, atime: result.atime,
mtime: result.mtime, mtime: result.mtime,
ctime: result.ctime ctime: result.ctime,
type: result.mode,
}; };
deferred.resolve(stats); deferred.resolve(stats);
} }

View File

@ -145,6 +145,7 @@ describe('fs.stat', function() {
expect(_result['atime']).toEqual(jasmine.any(Number)); expect(_result['atime']).toEqual(jasmine.any(Number));
expect(_result['mtime']).toEqual(jasmine.any(Number)); expect(_result['mtime']).toEqual(jasmine.any(Number));
expect(_result['ctime']).toEqual(jasmine.any(Number)); expect(_result['ctime']).toEqual(jasmine.any(Number));
expect(_result['type']).toBeDefined();
}); });
}); });
}); });