Subject: bug#22795: 25.0.91; Can't write read only file on w32

From: Eli Zaretskii <[email-masked]>
Date: Mon, 29 Feb 2016 20:48:30 +0200

> Date: Mon, 29 Feb 2016 10:05:26 -0800
> CC: <[email-masked]>
> From: "Ota, Takaaki" <[email-masked]>
> 
> I set a break pointer at write_region() in fileio.c and then perform
> the save-buffer command.  When emacs breaks at write_region() on 24.5
> the file's permission is changed to writable while on 25.0.91 the
> permission remains read-only.

Both results are wrong: the file should not exist when write_region is
called, because Emacs renamed it to the backup-file name.  The problem
is most probably in making the backup, so I suggest looking at
sys_rename instead.