From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#10489: 24.0.92; dired-do-copy may create infinite directory hierarchy Date: Fri, 13 Jan 2012 12:31:42 +0200 Message-ID: <83wr8vki5t.fsf@gnu.org> References: <87mx9su32g.fsf@web.de> <87sjjkfvwt.fsf@gmail.com> <8362ggkquq.fsf@gnu.org> <87pqeoro8p.fsf@gmail.com> Reply-To: Eli Zaretskii NNTP-Posting-Host: lo.gmane.org X-Trace: dough.gmane.org 1326450766 4533 80.91.229.12 (13 Jan 2012 10:32:46 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 13 Jan 2012 10:32:46 +0000 (UTC) Cc: 10489@debbugs.gnu.org To: Thierry Volpiatto Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Jan 13 11:32:42 2012 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1RleR7-0002dQ-PE for geb-bug-gnu-emacs@m.gmane.org; Fri, 13 Jan 2012 11:32:41 +0100 Original-Received: from localhost ([::1]:34286 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RleR6-000267-QX for geb-bug-gnu-emacs@m.gmane.org; Fri, 13 Jan 2012 05:32:40 -0500 Original-Received: from eggs.gnu.org ([140.186.70.92]:48448) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RleQz-00025q-9f for bug-gnu-emacs@gnu.org; Fri, 13 Jan 2012 05:32:38 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RleQt-0006fC-23 for bug-gnu-emacs@gnu.org; Fri, 13 Jan 2012 05:32:32 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:32957) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RleQt-0006f8-0Y for bug-gnu-emacs@gnu.org; Fri, 13 Jan 2012 05:32:27 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1RleRS-0005Mz-Ip for bug-gnu-emacs@gnu.org; Fri, 13 Jan 2012 05:33:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 13 Jan 2012 10:33:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 10489 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 10489-submit@debbugs.gnu.org id=B10489.132645073820589 (code B ref 10489); Fri, 13 Jan 2012 10:33:01 +0000 Original-Received: (at 10489) by debbugs.gnu.org; 13 Jan 2012 10:32:18 +0000 Original-Received: from localhost ([127.0.0.1]:55863 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1RleQk-0005M1-7c for submit@debbugs.gnu.org; Fri, 13 Jan 2012 05:32:18 -0500 Original-Received: from mtaout22.012.net.il ([80.179.55.172]:49763) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1RleQh-0005Lq-Ir for 10489@debbugs.gnu.org; Fri, 13 Jan 2012 05:32:16 -0500 Original-Received: from conversion-daemon.a-mtaout22.012.net.il by a-mtaout22.012.net.il (HyperSendmail v2007.08) id <0LXQ00900FVFXG00@a-mtaout22.012.net.il> for 10489@debbugs.gnu.org; Fri, 13 Jan 2012 12:31:37 +0200 (IST) Original-Received: from HOME-C4E4A596F7 ([77.124.136.230]) by a-mtaout22.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0LXQ009SNFWON180@a-mtaout22.012.net.il>; Fri, 13 Jan 2012 12:31:37 +0200 (IST) In-reply-to: <87pqeoro8p.fsf@gmail.com> X-012-Sender: halo1@inter.net.il X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:55675 Archived-At: > From: Thierry Volpiatto > Cc: 10489@debbugs.gnu.org > Date: Fri, 13 Jan 2012 09:38:30 +0100 > > > I don't think this will solves all the use cases. File names are not > > strings, you cannot compare them as literal strings and hope to plumb > > all the leaks. > A test with `equal' is already used in `dired-create-files', > (equal from to) > Is it the correct way to compare two filenames? I don't see how `equal' could help, unless someone teaches it to treat strings that are file names specially. I don't see such treatment in the current sources. > > Some situations which I think this patch will not handle correctly: > > > > . file names with different letter-case on a case-insensitive file > > system > Can you provide example or better a recipe. emacs -Q C-x d ~ RET C ~/test RET yes RET > > . relative vs absolute file names > Same. M-: (dired-copy-file-recursive "foo/../Test" "./Test" t) RET > > . file names that are hard links to the same directory (this includes > > the infamous 8+3 short aliases on Windows) > Don't know on Windows, (My knowledge of links in windows is very > limited) > here it is difficult (impossible as User) to Hardlink a directory: > > --8<---------------cut here---------------start------------->8--- > man ln: > -d, -F, --directory > allow the superuser to attempt to hard link directories > (note: will probably fail due to system restrictions, > even for the superuser) > --8<---------------cut here---------------end--------------->8--- We don't disallow superusers from using Emacs, nor restrict Emacs usage only to filesystems where links to directories are impossible, do we? ;-) And what about symlinks? On Windows, you can have "C:/PROGRA~1" be the alias of "C:/Program Files", for example. Bottom line, I think you need: . make both file names absolute by calling expand-file-name on each . resolve links by calling file-truename on each (this will handle the 8+3 alias issue, as well as, AFAIK, the issue with links) . compare case-insensitively on MS-Windows and MS-DOS