Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cp does not recursively copy from readonly location #98

Closed
xliyong opened this issue Dec 17, 2013 · 3 comments · Fixed by #870
Closed

cp does not recursively copy from readonly location #98

xliyong opened this issue Dec 17, 2013 · 3 comments · Fixed by #870
Assignees
Labels
fix Bug/defect, or a fix for such a problem help wanted

Comments

@xliyong
Copy link

xliyong commented Dec 17, 2013

shell.cp('-R', , dest) fails with the following error:

cp: copyFileSync: could not write to dest file (code=EACCES):

@Schoonology
Copy link
Contributor

Can we get a little more context? For one, the actual code used to produce the error, as your snippet is missing a sample. For two, is where you're trying to write a valid target?

@xliyong
Copy link
Author

xliyong commented Dec 18, 2013

Steps to reproduce it:

cd /tmp
mkdir -p a/b
echo "text" >> a/b/c.txt
chmod -R -w ./a

And I have the following script to copy /tmp/a to a new directory.

require('shelljs/global');
cp('-R', '/tmp/a/*', '/tmp/newdir')
wang@adnmacsg013:/tmp> shjs script.js
cp: copyFileSync: could not write to dest file (code=EACCES):/tmp/newdir/b/c.txt

@Schoonology
Copy link
Contributor

That's the exact kind of context I was talking about. Thanks, @leyonh - this will help immensely.

@nfischer nfischer added the fix Bug/defect, or a fix for such a problem label Feb 9, 2016
@nfischer nfischer self-assigned this Jul 4, 2018
nfischer added a commit that referenced this issue Jul 10, 2018
This is a redo of PR #555.

This rebases, cleans up a test, and fixes a bug (the original PR uses `fs.chown()` instead of `fs.chownSync()`).

Fixes #98
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fix Bug/defect, or a fix for such a problem help wanted
Projects
None yet
3 participants