return binding.fchmod(fd, modeNum(mode));
};
+if (constants.hasOwnProperty('O_SYMLINK')) {
+ fs.lchmod = function(path, mode, callback) {
+ callback = callback || noop;
+ fs.open(path, constants.O_WRONLY | constants.O_SYMLINK, function (err, fd) {
+ if (err) {
+ callback(err);
+ return;
+ }
+ fs.fchmod(fd, mode, callback);
+ });
+ };
+
+ fs.lchmodSync = function(path, mode) {
+ var fd = fs.openSync(path, constants.O_WRONLY | constants.O_SYMLINK);
+ return fs.fchmodSync(fd, mode);
+ };
+}
+
+
fs.chmod = function(path, mode, callback) {
binding.chmod(path, modeNum(mode), callback || noop);
};
return binding.chmod(path, modeNum(mode));
};
+if (constants.hasOwnProperty('O_SYMLINK')) {
+ fs.lchown = function(path, uid, gid, callback) {
+ callback = callback || noop;
+ fs.open(path, constants.O_WRONLY | constants.O_SYMLINK, function (err, fd) {
+ if (err) {
+ callback(err);
+ return;
+ }
+ fs.fchown(fd, uid, gid, callback);
+ });
+ };
+
+ fs.lchownSync = function(path, uid, gid) {
+ var fd = fs.openSync(path, constants.O_WRONLY | constants.O_SYMLINK);
+ return fs.fchownSync(fd, uid, gid);
+ };
+}
+
fs.fchown = function(fd, uid, gid, callback) {
binding.fchown(fd, uid, gid, callback || noop);
};