-
Notifications
You must be signed in to change notification settings - Fork 744
cp -L: Incorrect behavior for symlinks to regular files #407
Copy link
Copy link
Closed
Labels
fixBug/defect, or a fix for such a problemBug/defect, or a fix for such a problemhelp wantedmedium priority
Milestone
Description
#232 is an awesome contribution! I've been testing it out, and really like it. Here's one bug I noticed on my Ubuntu box, however, running Node v5.
cp('-RL', src, dest) doesn't work quite right. Here's some output I got that wasn't quite expected. The symlinks are both symlinks to file.txt (a regular file), but they're being treated like directories by the copy.
$ ls -RCF sub/ #notice that foo.lnk and sym.lnk are links (in this case, to file.txt)
sub/:
file.txt foo.lnk@ sym.lnk@
$ cat script.js
require('shelljs/global');
cp('-rL', 'sub/', 'new/');
$ rm -rf new/
$ node script.js
$ ls -RCF new/ # notice that foo.lnk is a directory, not a regular file
new/:
file.txt foo.lnk/
new/foo.lnk:Also, I noticed the tests focus on the maxdepth and cycle detection, but it might be good to throw in some tests to just for the very basic cp -L and cp -LR behavior.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
fixBug/defect, or a fix for such a problemBug/defect, or a fix for such a problemhelp wantedmedium priority