unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Incorrect error message for file operation in Windows
@ 2013-06-02 10:53 Ivanov Dmitry
  2013-06-02 15:57 ` Eli Zaretskii
  2013-06-02 20:50 ` Stefan Monnier
  0 siblings, 2 replies; 7+ messages in thread
From: Ivanov Dmitry @ 2013-06-02 10:53 UTC (permalink / raw)
  To: emacs-devel

I am using Emacs 24.1.1 (i386-mingw-nt5.1.2600) on Windows XP.

I tried the following code, copying file drupal.el from ~/.emacs.d  to e:/video:

(condition-case ex
     (copy-file "~/.emacs.d/drupal.el" "e:/video")
         ('error (message (format "Caught exception: [%s]" ex))))


My user doesn't have the right to write to "e:/video". So, I expected "permission denied" error. Instead I got:

"Caught exception: [(file-error Copying file no such file or directory d:/bin/cygwin/home/user/.emacs.d/drupal.el e:/video/drupal.el)]"

This error message is incorrect - file exists. Why is that? Bug?




^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Incorrect error message for file operation in Windows
  2013-06-02 10:53 Incorrect error message for file operation in Windows Ivanov Dmitry
@ 2013-06-02 15:57 ` Eli Zaretskii
  2013-06-02 16:45   ` Re[2]: " Ivanov Dmitry
  2013-06-02 20:50 ` Stefan Monnier
  1 sibling, 1 reply; 7+ messages in thread
From: Eli Zaretskii @ 2013-06-02 15:57 UTC (permalink / raw)
  To: Ivanov Dmitry; +Cc: emacs-devel

> Date: Sun, 2 Jun 2013 14:53:43 +0400
> From: Ivanov Dmitry <usr345@gmail.com>
> 
> I am using Emacs 24.1.1 (i386-mingw-nt5.1.2600) on Windows XP.

Can you try a later version?  Emacs 24.3 was released 2 months ago.

> I tried the following code, copying file drupal.el from ~/.emacs.d  to e:/video:
> 
> (condition-case ex
>      (copy-file "~/.emacs.d/drupal.el" "e:/video")
>          ('error (message (format "Caught exception: [%s]" ex))))
> 
> 
> My user doesn't have the right to write to "e:/video". So, I expected "permission denied" error. Instead I got:
> 
> "Caught exception: [(file-error Copying file no such file or directory d:/bin/cygwin/home/user/.emacs.d/drupal.el e:/video/drupal.el)]"
> 
> This error message is incorrect - file exists. Why is that? Bug?

Hard to say without more details.  Can you describe in detail what do
you mean by 'My user doesn't have the right to write to "e:/video"'?
What kind of filesystem is on drive E:, and why cannot your user write
there?



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re[2]: Incorrect error message for file operation in Windows
  2013-06-02 15:57 ` Eli Zaretskii
@ 2013-06-02 16:45   ` Ivanov Dmitry
  2013-06-02 17:11     ` Eli Zaretskii
  0 siblings, 1 reply; 7+ messages in thread
From: Ivanov Dmitry @ 2013-06-02 16:45 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: emacs-devel

> Can you describe in detail what do
> you mean by 'My user doesn't have the right to write to "e:/video"'?
> What kind of filesystem is on drive E:, and why cannot your user write there?

The filesystem is NTFS. OS: Windows XP SP3. I am working as an ordinary user, who can only read from E:\video, and can not write there.

I am trying to copy the file into this dir, checking what error will Emacs give.

I tried the same code in Emacs 24.3 - same error:

(condition-case ex
     (copy-file "~/.emacs.d/drupal.el" "e:/video")
         ('error (message (format "Caught exception: [%s]" ex))))

"no such file or directory" instead of "permission denied".




^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Incorrect error message for file operation in Windows
  2013-06-02 16:45   ` Re[2]: " Ivanov Dmitry
@ 2013-06-02 17:11     ` Eli Zaretskii
  2013-06-03 15:04       ` Eli Zaretskii
  0 siblings, 1 reply; 7+ messages in thread
From: Eli Zaretskii @ 2013-06-02 17:11 UTC (permalink / raw)
  To: Ivanov Dmitry; +Cc: emacs-devel

> Date: Sun, 2 Jun 2013 20:45:25 +0400
> From: Ivanov Dmitry <usr345@gmail.com>
> CC: emacs-devel@gnu.org
> 
> > Can you describe in detail what do
> > you mean by 'My user doesn't have the right to write to "e:/video"'?
> > What kind of filesystem is on drive E:, and why cannot your user write there?
> 
> The filesystem is NTFS. OS: Windows XP SP3. I am working as an ordinary user, who can only read from E:\video, and can not write there.

Thanks, but that's not enough info.

Windows XP rarely disallows writing to disk files and directories.
There are 2 possible ways of doing that:

 . Turn on the read-only attribute

 . Set NT security descriptor that denies write access

Since E:\video is a directory, I'm guessing yours is the latter case.
If so, could you perhaps show the NT security DACL descriptor of that
directory?  There are a couple of utilities floating around, like
subinacl, that can display the DACL in several formats; either SDDL or
human-readable description will be fine.

The reason I'm asking these questions is that I need to simulate the
problem on my machine and see what is going on there, to be able to
diagnose it.  I already tried a few directories that are private to
other users, and never got the error.  So some details are missing for
reproducing your error.

Thanks.



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Incorrect error message for file operation in Windows
  2013-06-02 10:53 Incorrect error message for file operation in Windows Ivanov Dmitry
  2013-06-02 15:57 ` Eli Zaretskii
@ 2013-06-02 20:50 ` Stefan Monnier
  2013-06-03  7:31   ` Re[2]: " Ivanov Dmitry
  1 sibling, 1 reply; 7+ messages in thread
From: Stefan Monnier @ 2013-06-02 20:50 UTC (permalink / raw)
  To: Ivanov Dmitry; +Cc: emacs-devel

> (condition-case ex
>     (copy-file "~/.emacs.d/drupal.el" "e:/video")
>   ('error (message (format "Caught exception: [%s]" ex))))

On an unrelated note: the above `condition-case' will catch the signals
`error' and `quote', but of course, there is no such thing as
a `quote' signal.  IOW you wanted to write:

   (condition-case ex
       (copy-file "~/.emacs.d/drupal.el" "e:/video")
     (error (message (format "Caught exception: [%s]" ex))))


        Stefan



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re[2]: Incorrect error message for file operation in Windows
  2013-06-02 20:50 ` Stefan Monnier
@ 2013-06-03  7:31   ` Ivanov Dmitry
  0 siblings, 0 replies; 7+ messages in thread
From: Ivanov Dmitry @ 2013-06-03  7:31 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: emacs-devel

> On an unrelated note: the above `condition-case' will catch the signals
> `error' and `quote', but of course, there is no such thing as
> a `quote' signal.  IOW you wanted to write:
> 
>    (condition-case ex
>        (copy-file "~/.emacs.d/drupal.el" "e:/video")
>      (error (message (format "Caught exception: [%s]" ex))))


Using your version now, thanks.




^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Incorrect error message for file operation in Windows
  2013-06-02 17:11     ` Eli Zaretskii
@ 2013-06-03 15:04       ` Eli Zaretskii
  0 siblings, 0 replies; 7+ messages in thread
From: Eli Zaretskii @ 2013-06-03 15:04 UTC (permalink / raw)
  To: usr345; +Cc: emacs-devel

> Date: Sun, 02 Jun 2013 20:11:18 +0300
> From: Eli Zaretskii <eliz@gnu.org>
> Cc: emacs-devel@gnu.org
> 
> > Date: Sun, 2 Jun 2013 20:45:25 +0400
> > From: Ivanov Dmitry <usr345@gmail.com>
> > CC: emacs-devel@gnu.org
> > 
> > > Can you describe in detail what do
> > > you mean by 'My user doesn't have the right to write to "e:/video"'?
> > > What kind of filesystem is on drive E:, and why cannot your user write there?
> > 
> > The filesystem is NTFS. OS: Windows XP SP3. I am working as an ordinary user, who can only read from E:\video, and can not write there.
> 
> Thanks, but that's not enough info.

Actually, additional info is not important, so you can stop looking
for it.

In Emacs 24.3 and earlier, copy-file called a Windows API that doesn't
set errno, and Emacs itself didn't check Windows-specific errors
triggered by that API.  So you can get any error at all reported
there.

The development trunk does check errors and sets errno accordingly, so
you get either "Permission denied" or "Access denied", and nothing
else.

Sorry I didn't check the code earlier.



^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2013-06-03 15:04 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-06-02 10:53 Incorrect error message for file operation in Windows Ivanov Dmitry
2013-06-02 15:57 ` Eli Zaretskii
2013-06-02 16:45   ` Re[2]: " Ivanov Dmitry
2013-06-02 17:11     ` Eli Zaretskii
2013-06-03 15:04       ` Eli Zaretskii
2013-06-02 20:50 ` Stefan Monnier
2013-06-03  7:31   ` Re[2]: " Ivanov Dmitry

Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).