- Version:
v11.2.0
- Platform:
Darwin iMac.local 18.2.0 Darwin Kernel Version 18.2.0: Thu Dec 20 20:46:53 PST 2018; root:xnu-4903.241.1~1/RELEASE_X86_64 x86_64
- Subsystem:
When setting a file mode to 444 using chmodSync, then trying to copy another file over it, on Windows and on Linux, copyFile will throw an error, but on a Mac it does not, and it will override the file
fs.chmodSync(dest, '444');
// then try to
fs.copyFile(source, dest, function (err) {
// i do expect an err here,
// but there is no error on Mac
});
i even check the stat.mode using parseInt(fs.statSync(dest).mode.toString(8), 10) and it does in fact say 100444
This is a sample when everything is working well
https://repl.it/repls/CylindricalGlisteningCondition
However, when i run it on my mac, I get this
This platform is darwin
fs.stat.mode ./dest: 100444
/Users/akhoury/rcloned/code/NodeBB/rrr.js:26
throw new Error(`This should've thrown an error!`);
^
Error: This should've thrown an error!
Thanks
v11.2.0Darwin iMac.local 18.2.0 Darwin Kernel Version 18.2.0: Thu Dec 20 20:46:53 PST 2018; root:xnu-4903.241.1~1/RELEASE_X86_64 x86_64When setting a file mode to
444usingchmodSync, then trying to copy another file over it, on Windows and on Linux,copyFilewill throw an error, but on a Mac it does not, and it will override the filei even check the
stat.modeusingparseInt(fs.statSync(dest).mode.toString(8), 10)and it does in fact say100444This is a sample when everything is working well
https://repl.it/repls/CylindricalGlisteningCondition
However, when i run it on my mac, I get this
Thanks