[Top][All Lists]

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

Re: bug in copy-directory

From: Thierry Volpiatto
Subject: Re: bug in copy-directory
Date: Tue, 01 Feb 2011 12:57:30 +0100
User-agent: Gnus/5.110011 (No Gnus v0.11) Emacs/23.2.92 (gnu/linux)

Michael Albinus <address@hidden> writes:

> Chong Yidong <address@hidden> writes:
>> Michael Albinus <address@hidden> writes:
>>> Your patch breaks recursive copy now. Extend the use case from that bug
>>> report:
>>> - Create directory /tmp/test
>>> - Create directory /tmp/test/test
>>> - Create file /tmp/test/a
>>> - Create file /tmp/test/test/b
>>> - Apply (copy-directory "/tmp/test" "~/")
>>>   Everything is fine
>>> - Apply again (copy-directory "/tmp/test" "~/")
>>>   The target directory structure is broken.
>> I think I see the problem: the arguments to the recursive call to
>> copy-directory were not taking the "copy as a subdirectory" behavior
>> into account.  I've committed a fix.
> It works fine, thank you. But there seems to be a bug in dired; when I
> copy "/tmp/test" to "~/" twice, I see the corrupted directory structure.
Yes i think i found the cause:
When dired give the destination name to copy-directory, the destination
name is already computed like:
        (setq newname (expand-file-name
                        (directory-file-name directory))

and copy-directory recompute it in the same way.

So from dired when you do:
copy directory /tmp/test to ~/

copy-directory does:
(copy-directory "/tmp/test" "~/test")

and then compute ~/test to ~/test/test.

It should do (copy-directory "/tmp/test" "~/")

> (This seems to be the misunderstanding between Thierry and me, 'cause I
> have used dired for my tests).
> I've tested also
> (copy-directory "/ssh::/tmp/test" "/ssh::~/")
> (copy-directory "/rsync::/tmp/test" "/rsync::~/")
> In the ssh case, Tramp falls back to the default implementation. For
> rsync, there is an own implementation. Both tests are successful; Tramp
> seems to be OK.

> Best regards, Michael.

A+ Thierry
Get my Gnupg key:
gpg --keyserver pgp.mit.edu --recv-keys 59F29997 

reply via email to

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