# bug1
# cp gets confused when copying a symbolic link when the target link already exists

cd /tmp
rm -rf cptest*
mkdir cptest
mkdir cptest2
echo foo > cptest/foo
ln -s foo cptest/foolink
cp -auxv cptest/* cptest2
ls -l cptest* # looks good
rm cptest/foolink
sleep 2 # let the clock advance
ln -s foo cptest/foolink # make the date on the link newer
cp -auxv cptest/* cptest2

# gives error: cp: cannot create symbolic link `cptest2/foolink': File exists

# bug2
# now almost the same thing except the link target doesn't exist

cd /tmp
rm -rf cptest*
mkdir cptest
mkdir cptest2
ln -s foo cptest/foolink
cp -auxv cptest/* cptest2 
ls -l cptest* # looks good
rm cptest/foolink
sleep 2 # let the clock advance
ln -s foo cptest/foolink # make the date on the link newer
cp -auxv cptest/* cptest2 

# gives: cp: overwrite `cptest2/foolink', overriding mode 0777? 
# even though --interactive was not specified

If you do consider either of these to be errors and would like me to find and fix them 
and send you a patch please let me know.

Andrew

Reply via email to