diff --git a/index.js b/index.js index 6407749..2662046 100644 --- a/index.js +++ b/index.js @@ -25,6 +25,7 @@ const ops = { fgetattr: require('./ops/fgetattr'), symlink: require('./ops/symlink'), readlink: require('./ops/readlink'), + chmod: require('./ops/chmod'), } ;(async () => { diff --git a/ops/chmod.js b/ops/chmod.js new file mode 100644 index 0000000..f4264d8 --- /dev/null +++ b/ops/chmod.js @@ -0,0 +1,18 @@ +const Fuse = require('fuse-native') +const Errors = require('../../shared/Errors') +const Message = require('../../shared/Message') +const connector = require('../connector') + +module.exports = exports = function (path, mode, cb) { + connector.send( + Message.route('fs.chmod') + .data({ path, mode }) + .expect_response(msg => { + if ( msg.error() ) { + return Errors.toCallback(cb, msg.error()) + } + + return process.nextTick(cb, 0) + }) + ) +}