-
Notifications
You must be signed in to change notification settings - Fork 80
Open
Description
How to reproduce:
- Create file structure like this:
mkdir -p src/bar # create nested folders
touch src/bar/test.txt # create file
chmod -w -R src # revoke write permissions- Try to copy
srcfolder with cpr:
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 -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
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels