How to use the ftruncateSync function from graceful-fs
Find comprehensive JavaScript graceful-fs.ftruncateSync code examples handpicked from public code repositorys.
GitHub: rstudio/shiny-server
143 144 145 146 147 148 149 150 151
if (!posix.acquireRecordLock(fd, F_WRLCK, SEEK_SET, 0, 0)) { return false; } var buf = Buffer.from(process.pid + '', 'ascii'); fs.ftruncateSync(fd, 0); var pos = 0; while (pos < buf.length) pos += fs.writeSync(fd, buf, pos, buf.length - pos, pos);
291
672
0
GitHub: canarddu38/DUCKSPLOIT
529 530 531 532 533 534 535 536 537 538 539 540
// truncate exports.truncate = Promise.promisify(fs.truncate); exports.truncateSync = fs.truncateSync; exports.ftruncate = Promise.promisify(fs.ftruncate); exports.ftruncateSync = fs.ftruncateSync; // unlink exports.unlink = Promise.promisify(fs.unlink); exports.unlinkSync = fs.unlinkSync;
9
48
0
+ 7 other calls in file
graceful-fs.promises is the most popular function in graceful-fs (1135 examples)