How to use the chmodSync function from graceful-fs

Find comprehensive JavaScript graceful-fs.chmodSync code examples handpicked from public code repositorys.

419
420
421
422
423
424
425
426
427
428
429
exports.appendFile = appendFile;
exports.appendFileSync = appendFileSync;


// chmod
exports.chmod = Promise.promisify(fs.chmod);
exports.chmodSync = fs.chmodSync;
exports.fchmod = Promise.promisify(fs.fchmod);
exports.fchmodSync = fs.fchmodSync;
exports.lchmod = Promise.promisify(fs.lchmod);
exports.lchmodSync = fs.lchmodSync;
fork icon9
star icon48
watch icon0

+ 7 other calls in file

63
64
65
66
67
68
69
70
71
72
73
}


function copyFile (srcStat, src, dest, opts) {
  if (typeof fs.copyFileSync === 'function') {
    fs.copyFileSync(src, dest)
    fs.chmodSync(dest, srcStat.mode)
    if (opts.preserveTimestamps) {
      return utimesSync(dest, srcStat.atime, srcStat.mtime)
    }
    return
fork icon0
star icon0
watch icon0

+ 5 other calls in file

217
218
219
220
221
222
223
224
225
226
  if (options.fsync !== false) {
    fs.fsyncSync(fd)
  }
  fs.closeSync(fd)
  if (options.chown) fs.chownSync(tmpfile, options.chown.uid, options.chown.gid)
  if (options.mode) fs.chmodSync(tmpfile, options.mode)
  fs.renameSync(tmpfile, filename)
  removeOnExitHandler()
} catch (err) {
  if (fd) {
fork icon0
star icon0
watch icon0

+ 3 other calls in file

106
107
108
109
110
111
112
113
114
115
116
	}
};


exports.chmodSync = (path, mode) => {
	try {
		return fs.chmodSync(path, mode);
	} catch (error) {
		throw new CpFileError(`chmod \`${path}\` failed: ${error.message}`, error);
	}
};
fork icon0
star icon0
watch icon0