From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: LynX <_LynX@bk.ru> Newsgroups: gmane.emacs.devel Subject: Re: "Renaming: permission denied" file-error in Windows Date: Sun, 11 Dec 2011 19:30:11 +0000 Message-ID: <4EE504C3.3090701@bk.ru> References: <4EE3F66D.2050003@bk.ru> <83vcpnllo3.fsf@gnu.org> <4EE46AA1.9010700@cs.ucla.edu> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1323626657 3768 80.91.229.12 (11 Dec 2011 18:04:17 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sun, 11 Dec 2011 18:04:17 +0000 (UTC) Cc: Paul Eggert , emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Dec 11 19:04:11 2011 Return-path: Envelope-to: ged-emacs-devel@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 1RZnkw-00044p-Kq for ged-emacs-devel@m.gmane.org; Sun, 11 Dec 2011 19:04:10 +0100 Original-Received: from localhost ([::1]:36774 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RZnkw-0001OH-7J for ged-emacs-devel@m.gmane.org; Sun, 11 Dec 2011 13:04:10 -0500 Original-Received: from eggs.gnu.org ([140.186.70.92]:53146) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from <_LynX@bk.ru>) id 1RZnEq-0002a2-1b for emacs-devel@gnu.org; Sun, 11 Dec 2011 12:31:00 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from <_LynX@bk.ru>) id 1RZnEp-0000Ww-2s for emacs-devel@gnu.org; Sun, 11 Dec 2011 12:31:00 -0500 Original-Received: from smtp20.mail.ru ([94.100.176.173]:51540) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <_LynX@bk.ru>) id 1RZnEm-0000WT-Aj; Sun, 11 Dec 2011 12:30:56 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mail.ru; s=mail; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:References:Subject:CC:To:MIME-Version:From:Date:Message-ID; bh=iXTteBQ/2YDndkeeHf26eoishHhUGoePsbpX01/kDx4=; b=mc6USD3FFq7eE2xxYBM+WESPKzCV20Z4BGuenVvGyPeAXWnIzucXkbJsmIwRONycuLoMiBqg1eZcjnZ6u1dPiz6m0W7pzp+5NLCCGSAky13w+lrmjFGQlPGV6l4dHRgC; Original-Received: from [109.200.245.204] (port=33203 helo=[109.200.245.204]) by smtp20.mail.ru with asmtp id 1RZnEk-0003mG-00; Sun, 11 Dec 2011 21:30:54 +0400 User-Agent: Mozilla/5.0 (X11; Linux i686; rv:6.0.2) Gecko/20110902 Thunderbird/6.0.2 In-Reply-To: X-Spam: Not detected X-Mras: Ok X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 94.100.176.173 X-Mailman-Approved-At: Sun, 11 Dec 2011 13:04:08 -0500 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:146653 Archived-At: On 12/11/2011 12:51 PM, Eli Zaretskii wrote: > Ah, I see the problem now: the implementation of `rename' on Windows > does not return errno = EXDEV in that case, so the recursive copying > does not happen. Oh, yes you are right :). Here is a simple c code which demonstrates this: #include #include #include #include int main(int argc, char* argv[]) { // in Windows path of course was a bit different :) int ret = rename("/media/c/toDel/test", "/media/g/Temp"); perror("error"); printf("ret %d errno %d\n", ret, errno); if (errno == EXDEV) { printf("EXDEV\n"); } else if (errno == EACCES) { printf("EACCES\n"); } while(1); return 0; } In Linux output is: ret -1 errno 18 EXDEV In Windows: error: Permission denied ret -1 errno 13 EACCES So for Windows rename returns EACCES instead of EXDEV. Maybe to fix it in Windows we need to check rename error code not only for EXDEV but for EACCES also. > > I encourage the OP to file a bug report (using "M-x report-emacs-bug") > about this. It should be easy to fix this. > > Sorry, what "OP" means? :) Regards, LX