bug-coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug in cp -R -L ?


From: Christophe LYON
Subject: bug in cp -R -L ?
Date: Fri, 03 Feb 2006 10:24:01 +0100
User-agent: Thunderbird 1.5 (X11/20051201)

Hi all,

I am using coreutils-5.93 and I have the following problem:
Consider the following hierarchy:
mkdir:
        file
src:
        dir1:
                cp1 -> ../../mydir
        dir2:
                cp2 -> ../../mydir

Now, I want to use
cp -R -L src dest
which fails with the following message:
cp: will not create hard link `dest/src/dir2/cp2' to directory `dest/src/dir1/cp1'


I have looked at the sources and discovered the "optimizations" around hard links :-), which helped me understand the problem.

The issue is in copy.c:copy_internal(), because when trying to copy src/dir2/cp2, earlier_file is not NULL.

This is because XSTAT replies that src/dir2/cp2 is a directory (because of -L) and obviously it is the same as the one pointed to by src/dir1/cp1.

Is this a bug, or am I missing an options to achieve what I want (ie have 2 copies of mydir in dest/dir1/cp1 and dest/dir2/cp2) ?

Thanks,

Christophe.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]