Open isqua opened 4 years ago
How to reproduce:
mkdir -p src/bar # create nested folders touch src/bar/test.txt # create file chmod -w -R src # revoke write permissions
src
const cpr = require('cpr') cpr('src', 'dest', (err, res) => { if (err) throw err; console.log(res) })
It will produce this error:
Uncaught [Error: Unable to copy directory entirely] { list: [ [Error: EACCES: permission denied, mkdir '/path/to/dest/bar'] { errno: -13, code: 'EACCES', syscall: 'mkdir', path: '/path/to/dest/bar' }, [Error: ENOENT: no such file or directory, open 'dest/bar/test.txt'] { errno: -2, code: 'ENOENT', syscall: 'open', path: 'dest/bar/test.txt' } ] }
I expect behaviour as original cp command has:
cp
cp -R src dest # success ls -l dest total 0 dr-xr-xr-x 3 isqua isqua 102 Oct 30 22:53 ./ drwxr-xr-x 19 isqua isqua 646 Oct 30 22:53 ../ dr-xr-xr-x 3 isqua isqua 102 Oct 30 22:53 bar/ ll dest/bar total 0 dr-xr-xr-x 3 isqua isqua 102 Oct 30 22:53 ./ dr-xr-xr-x 3 isqua isqua 102 Oct 30 22:53 ../ -r--r--r-- 1 isqua isqua 0 Oct 30 22:53 test.txt
NodeJS version: v12.18.1 cpr version: 3.0.1, 2.2.0
How to reproduce:
src
folder with cpr:It will produce this error:
I expect behaviour as original
cp
command has:NodeJS version: v12.18.1 cpr version: 3.0.1, 2.2.0