From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: martin rudalics Newsgroups: gmane.emacs.devel Subject: renaming directories on windows port Date: Wed, 21 Jun 2006 16:08:32 +0200 Message-ID: NNTP-Posting-Host: main.gmane.org X-Trace: sea.gmane.org 1150898849 14312 80.91.229.2 (21 Jun 2006 14:07:29 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 21 Jun 2006 14:07:29 +0000 (UTC) Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Jun 21 16:07:27 2006 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1Ft3MQ-0004ZG-K1 for ged-emacs-devel@m.gmane.org; Wed, 21 Jun 2006 16:07:14 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Ft3MQ-0004Hk-6T for ged-emacs-devel@m.gmane.org; Wed, 21 Jun 2006 10:07:14 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Ft3MF-0004HS-7K for emacs-devel@gnu.org; Wed, 21 Jun 2006 10:07:03 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Ft3MD-0004Fi-DH for emacs-devel@gnu.org; Wed, 21 Jun 2006 10:07:02 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Ft3MD-0004FO-7d for emacs-devel@gnu.org; Wed, 21 Jun 2006 10:07:01 -0400 Original-Received: from [213.165.64.21] (helo=mail.gmx.net) by monty-python.gnu.org with smtp (Exim 4.52) id 1Ft3Wy-0001GA-7Q for emacs-devel@gnu.org; Wed, 21 Jun 2006 10:18:08 -0400 Original-Received: (qmail invoked by alias); 21 Jun 2006 14:06:56 -0000 Original-Received: from N922P004.adsl.highway.telekom.at (EHLO MACHNO) [62.47.59.36] by mail.gmx.net (mp042) with SMTP; 21 Jun 2006 16:06:56 +0200 X-Authenticated: #14592706 Original-To: emacs-devel@gnu.org X-Y-GMX-Trusted: 0 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:56052 Archived-At: On Windows when I have a directory called "c:/temp/foo" and try to (rename-file "c:/temp/foo" "c:/temp/FOO") Emacs tells me (file-error "Renaming" "no such file or directory" "c:/TEMP/foo" "c:/TEMP/FOO/foo") When `file' names a directory, and `newname' and `file' differ in case only, the intended action of `rename-file' on Windows reasonably is to just change the case of the directory name. The trivial patch below should resolve this: 2006-06-21 Martin Rudalics * fileio.c (Frename_file): Don't try to move directory to itself on DOS_NT platforms. *** fileio.c Tue Jun 6 19:20:40 2006 --- fileio.c Wed Jun 21 11:41:34 2006 *************** *** 2750,2756 **** CHECK_STRING (newname); file = Fexpand_file_name (file, Qnil); ! if (!NILP (Ffile_directory_p (newname))) newname = Fexpand_file_name (Ffile_name_nondirectory (file), newname); else newname = Fexpand_file_name (newname, Qnil); --- 2750,2762 ---- CHECK_STRING (newname); file = Fexpand_file_name (file, Qnil); ! if ((!NILP (Ffile_directory_p (newname))) ! #ifdef DOS_NT ! /* If the file names are identical but for the case, ! don't attempt to move directory to itself. */ ! && (NILP (Fstring_equal (Fdowncase (file), Fdowncase (newname)))) ! #endif ! ) newname = Fexpand_file_name (Ffile_name_nondirectory (file), newname); else newname = Fexpand_file_name (newname, Qnil);