How to use the chownSync function from graceful-fs
Find comprehensive JavaScript graceful-fs.chownSync code examples handpicked from public code repositorys.
GitHub: canarddu38/DUCKSPLOIT
427 428 429 430 431 432 433 434 435 436 437
exports.lchmod = Promise.promisify(fs.lchmod); exports.lchmodSync = fs.lchmodSync; // chown exports.chown = Promise.promisify(fs.chown); exports.chownSync = fs.chownSync; exports.fchown = Promise.promisify(fs.fchown); exports.fchownSync = fs.fchownSync; exports.lchown = Promise.promisify(fs.lchown); exports.lchownSync = fs.lchownSync;
+ 7 other calls in file
49 50 51 52 53 54 55 56 57 58 59
const isRoot = process.getuid && process.getuid() === 0 const isSudo = isRoot && process.env.SUDO_UID && process.env.SUDO_GID if (isSudo) { const sudoUid = +process.env.SUDO_UID const sudoGid = +process.env.SUDO_GID fs.chownSync(commonCache, sudoUid, sudoGid) } const returnCwd = path.dirname(__dirname) const find = require('which').sync('find')
+ 3 other calls in file
216 217 218 219 220 221 222 223 224 225
} 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) {
+ 3 other calls in file
GitHub: Sathish9686/Gadgets-Page
114 115 116 117 118 119 120 121 122 123 124
} }; exports.chownSync = (path, uid, gid) => { try { return fs.chownSync(path, uid, gid); } catch (error) { throw new CpFileError(`chown \`${path}\` failed: ${error.message}`, error); } };
GitHub: addaleax/test-1234
![addaleax profile picture](/addaleax.png?size=40)
15 16 17 18 19 20 21 22 23 24
} var realChownSync fs.chownSync = function(path, uid, gid) { try { fs.chownSync(path, uid, gid); } catch (er) { if (er) console.trace('chownSync failed', er, path, uid, gid) throw er }
+ 3 other calls in file
graceful-fs.promises is the most popular function in graceful-fs (1135 examples)