26 lines
793 B
JavaScript
26 lines
793 B
JavaScript
const Fuse = require('fuse-native')
|
|
const Errors = require('../../shared/Errors')
|
|
const Message = require('../../shared/Message')
|
|
const connector = require('../connector')
|
|
|
|
module.exports = exports = function (path, fd, cb) {
|
|
connector.send(
|
|
Message.route('fs.fgetattr')
|
|
.data({ path, descriptor: fd })
|
|
.expect_response(msg => {
|
|
if ( msg.error() ) {
|
|
return Errors.toCallback(cb, msg.error())
|
|
}
|
|
|
|
const { node } = msg.data()
|
|
|
|
delete node.pied_name
|
|
node.mtime = new Date(node.mtime)
|
|
node.atime = new Date(node.atime)
|
|
node.ctime = new Date(node.ctime)
|
|
|
|
return process.nextTick(cb, 0, node)
|
|
})
|
|
)
|
|
}
|