function chmod(path, mode) {
        var deferred = new $.Deferred();

        brackets.fs.chmod(path, parseInt(mode, 8), function (err) {
            if (err) {
                deferred.reject(err);
            } else {
                deferred.resolve();
            }
        });

        return deferred.promise();
    }
Set permissions on a path
@param {!string} path Path to change permissions on
@param {!string} mode New mode as an octal string
@return {$.Promise} Resolved when permissions are set or rejected if an error occurs