From 09409643673c2f78648cca925331a288983f16d7 Mon Sep 17 00:00:00 2001 From: mehdi Date: Tue, 27 Oct 2020 17:15:02 +0100 Subject: [PATCH] make octal numerals modern and coherent --- lib/temp.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/temp.js b/lib/temp.js index 27cc78b..377f693 100644 --- a/lib/temp.js +++ b/lib/temp.js @@ -262,7 +262,7 @@ const mkdir = (affixes, callback) => { callback = p[1]; let dirPath = generateName(affixes, 'd-'); - mkdirp(dirPath, 0700, (err) => { + mkdirp(dirPath, 0o700, (err) => { if (!err) { deleteDirOnExit(dirPath); } @@ -273,7 +273,7 @@ const mkdir = (affixes, callback) => { const mkdirSync = (affixes) => { let dirPath = generateName(affixes, 'd-'); - mkdirp.sync(dirPath, 0700); + mkdirp.sync(dirPath, 0o700); deleteDirOnExit(dirPath); return dirPath; } @@ -286,7 +286,7 @@ const open = (affixes, callback) => { callback = p[1]; const path = generateName(affixes, 'f-'); - fs.open(path, RDWR_EXCL, parseInt('0600', 8), (err, fd) => { + fs.open(path, RDWR_EXCL, 0o600, (err, fd) => { if (!err) { deleteFileOnExit(path); } @@ -297,14 +297,14 @@ const open = (affixes, callback) => { const openSync = (affixes) => { const path = generateName(affixes, 'f-'); - let fd = fs.openSync(path, RDWR_EXCL, parseInt('0600', 8)); + let fd = fs.openSync(path, RDWR_EXCL, 0o600); deleteFileOnExit(path); return { path, fd }; } const createWriteStream = (affixes) => { const path = generateName(affixes, 's-'); - let stream = fs.createWriteStream(path, { flags: RDWR_EXCL, mode: parseInt('0600', 8) }); + let stream = fs.createWriteStream(path, { flags: RDWR_EXCL, mode: 0o600 }); deleteFileOnExit(path); return stream; }