How to use the fchownSync function from fs

Find comprehensive JavaScript fs.fchownSync code examples handpicked from public code repositorys.

42
43
44
45
46
47
48
49
50
51
  }
};
exports.fchmod = co.promisify(fs.fchmod);
exports.fchmodSync = fs.fchmodSync;
exports.fchown = co.promisify(fs.fchown);
exports.fchownSync = fs.fchownSync;
exports.fdatasync = co.promisify(fs.fdatasync);
exports.fdatasyncSync = fs.fdatasyncSync;
exports.fstat = co.promisify(fs.fstat);
exports.fstatSync = fs.fstatSync;
fork icon22
star icon45
watch icon26

779
780
781
782
783
784
785
786
787
788
789
  common.runWithInvalidFD((fd) => {
    fs.fchown(fd, process.getuid(), process.getgid(),
              common.mustCall(validateError));


    assert.throws(
      () => fs.fchownSync(fd, process.getuid(), process.getgid()),
      validateError
    );
  });
}
fork icon42
star icon19
watch icon0

773
774
775
776
777
778
779
780
781
782
if (this[DOCHOWN](entry)) {
  const uid = this[UID](entry)
  const gid = this[GID](entry)

  try {
    fs.fchownSync(fd, uid, gid)
  } catch (fchowner) {
    try {
      fs.chownSync(entry.absolute, uid, gid)
    } catch (chowner) {
fork icon3
star icon2
watch icon0