all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: LynX <_LynX@bk.ru>
To: Eli Zaretskii <eliz@gnu.org>
Cc: Paul Eggert <eggert@cs.ucla.edu>, emacs-devel@gnu.org
Subject: Re: "Renaming: permission denied" file-error in Windows
Date: Sun, 11 Dec 2011 19:30:11 +0000	[thread overview]
Message-ID: <4EE504C3.3090701@bk.ru> (raw)
In-Reply-To: <E1RZisW-0000Ok-0C@fencepost.gnu.org>

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 <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <errno.h>

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



  reply	other threads:[~2011-12-11 19:30 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-11  0:16 "Renaming: permission denied" file-error in Windows LynX
2011-12-11  5:30 ` Eli Zaretskii
2011-12-11  5:32   ` Tekk
2011-12-11  5:42     ` Eli Zaretskii
2011-12-11  8:32   ` Paul Eggert
2011-12-11 12:51     ` Eli Zaretskii
2011-12-11 19:30       ` LynX [this message]
2011-12-11 18:03         ` Eli Zaretskii
2011-12-11 21:45           ` LynX
2011-12-11 21:31             ` Eli Zaretskii
2011-12-25  7:33               ` LynX
2011-12-25  9:39                 ` bug#10284: " Eli Zaretskii
2011-12-25  9:40                 ` Eli Zaretskii
2011-12-28 19:53                   ` bug#10284: " LynX
2011-12-29  6:18                     ` Eli Zaretskii
2011-12-30 19:31                       ` LynX
2011-12-30 20:23                         ` Eli Zaretskii
2011-12-30 21:35                           ` LynX
2011-12-31  6:48                             ` Eli Zaretskii
2012-01-06 20:46                               ` LynX
2012-01-07  9:54                                 ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4EE504C3.3090701@bk.ru \
    --to=_lynx@bk.ru \
    --cc=eggert@cs.ucla.edu \
    --cc=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.