bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#5343: 23.1.91; recursive directory copying is broken


From: Michael Albinus
Subject: bug#5343: 23.1.91; recursive directory copying is broken
Date: Tue, 12 Jan 2010 23:07:31 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.91 (gnu/linux)

Stephen Berman <stephen.berman@gmx.net> writes:

>> 1. emacs -Q
>> 2. Make a directory /tmp/test, add to it a file named "a" and a
>>    directory named "test", and add to /tmp/test/test a file named "b".
>> 3. Type `M-x copy-directory RET /tmp/test RET ~ RET' to copy /tmp/test
>>    recursively to ~.
>> 4. Type `C-x d' and at the prompt `~' to visit ~ in Dired, put the
>>    cursor on the directory "test" and type `i' to open "test" as a
>>    subdirectory.  This is the result:
>>
>>   /home/steve/test:
>>   total used in directory 16 available 7794948
>>   -rw-r--r--  1 steve users    4 2010-01-08 23:57 a
>>   -rw-r--r--  1 steve users    7 2010-01-08 23:57 b

Should be fixed now. However, the patch is a little bit different from
yours.

> This is due to the following code in copy-directory:
>
>     (if (and (file-directory-p newname)
>              (not (string-equal (file-name-nondirectory directory)
>                               (file-name-nondirectory newname))))
>       (setq newname
>             (expand-file-name (file-name-nondirectory directory) newname)))
>
> Specifically, the equality check prevents newname from being changed
> from "home/steve/test" to "home/steve/test/test".  Removing this check,
> as in the below patch, fixes the above breakage.  I don't see any real
> problem this check prevents, but maybe I'm overlooking something.

IIRC, there were some problems when copying a directory into an existing
one. Cannot remember the exact test case, because I haven't written a
comment about.

> Steve Berman

Best regards, Michael.






reply via email to

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