From: "Ota, Takaaki" <Takaaki.Ota@am.sony.com>
To: <eliz@gnu.org>
Cc: 22795@debbugs.gnu.org
Subject: bug#22795: 25.0.91; Can't write read only file on w32
Date: Mon, 29 Feb 2016 09:53:54 -0800 [thread overview]
Message-ID: <20160229.095354.534976457.Takaaki.Ota@am.sony.com> (raw)
In-Reply-To: <83h9gr8mns.fsf@gnu.org>
Mon, 29 Feb 2016 19:13:43 +0200: Eli Zaretskii <eliz@gnu.org> wrote:
> > Date: Mon, 29 Feb 2016 08:40:35 -0800
> > CC: <22795@debbugs.gnu.org>
> > From: "Ota, Takaaki" <Takaaki.Ota@am.sony.com>
> >
> > I am now very much puzzled. Here is the trace up to _wopen(). I
> > printed parameters to _wopen() and they are identical yet one succeeds
> > and the other fails.
>
> Hmm... strange, indeed.
>
> Do you have a dependency walker program? (If not, you can download it
> from http://www.dependencywalker.com/.) Can you tell whether the two
> executables differ in the versions of msvcrt.dll they are linked
> against? Or any other dynamic libraries, for that matter?
>
> Also, what is the value of errno after the _wopen call that fails?
4303 res = _wopen (mpath_w, (oflag & ~_O_CREAT) | _O_NOINHERIT, mode);
(gdb) s
4304 if (res < 0)
(gdb) p res
$6 = -1
(gdb) p errno
$7 = 13
So it must be this.
#define EACCES 13 /* Permission denied */
>
> Finally, what about this part of my questions, did you look into this:
>
> > Also, I think by the time this code is run, the original file should
> > have been renamed to the backup-file name, so the file you are saving
> > should not exist on disk by the time we open it. If that is not the
> > case with 25.0.91, then perhaps what fails is not the open call, but
> > the rename call before that.
>
> Does the file that Emacs tries to open here, c:\d\ota\memo, exist when
> _wopen is called, and if so, is it read-only? Please check this with
> both versions of Emacs, and see if there's any differences in what
> happens.
In both cases the original file exists right before calling _wopen()
but there is a difference. On 25.0.91 the file remains read-only but
on 24.5 the file is writable right before calling _open(). Now we
have some clue here.
-Tak
next prev parent reply other threads:[~2016-02-29 17:53 UTC|newest]
Thread overview: 34+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-02-24 16:44 bug#22795: 25.0.91; Can't write read only file on w32 Ota, Takaaki
2016-02-24 19:09 ` Eli Zaretskii
2016-02-24 21:57 ` Ota, Takaaki
2016-02-25 16:47 ` Eli Zaretskii
2016-02-25 17:08 ` Ota, Takaaki
2016-02-25 17:12 ` Ota, Takaaki
2016-02-25 18:09 ` Eli Zaretskii
2016-02-25 18:15 ` Ota, Takaaki
2016-02-26 19:26 ` Ota, Takaaki
2016-02-26 21:53 ` Eli Zaretskii
2016-02-29 16:40 ` Ota, Takaaki
2016-02-29 17:13 ` Eli Zaretskii
2016-02-29 17:39 ` Ota, Takaaki
2016-02-29 17:53 ` Ota, Takaaki [this message]
2016-02-29 18:05 ` Ota, Takaaki
2016-02-29 18:48 ` Eli Zaretskii
2016-02-29 19:28 ` Ota, Takaaki
2016-02-29 20:06 ` Eli Zaretskii
2016-02-29 21:34 ` Ota, Takaaki
2016-03-01 16:27 ` Eli Zaretskii
2016-05-14 9:17 ` Eli Zaretskii
2016-05-19 18:47 ` Ota, Takaaki
2016-05-19 19:47 ` Eli Zaretskii
2016-05-25 16:55 ` Eli Zaretskii
2016-06-01 17:22 ` Ota, Takaaki
2016-06-04 9:01 ` Eli Zaretskii
2016-06-06 16:24 ` Ota, Takaaki
2016-06-06 19:10 ` Eli Zaretskii
2016-06-06 20:46 ` Ota, Takaaki
2016-06-07 2:42 ` Eli Zaretskii
2016-06-07 23:02 ` Ota, Takaaki
2016-06-08 17:07 ` Eli Zaretskii
2016-12-07 21:08 ` Glenn Morris
2016-02-29 18:31 ` 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
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20160229.095354.534976457.Takaaki.Ota@am.sony.com \
--to=takaaki.ota@am.sony.com \
--cc=22795@debbugs.gnu.org \
--cc=eliz@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 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).