From debbugs-submit-bounces@debbugs.gnu.org Sun Sep 15 04:22:40 2013 Received: (at submit) by debbugs.gnu.org; 15 Sep 2013 08:22:41 +0000 Received: from localhost ([127.0.0.1]:38005 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VL7bM-0000sc-CN for submit@debbugs.gnu.org; Sun, 15 Sep 2013 04:22:40 -0400 Received: from eggs.gnu.org ([208.118.235.92]:34250) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VL7bK-0000sM-3C for submit@debbugs.gnu.org; Sun, 15 Sep 2013 04:22:39 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VL7b5-0006G6-2L for submit@debbugs.gnu.org; Sun, 15 Sep 2013 04:22:32 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,FREEMAIL_FROM autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:37573) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VL7b4-0006G2-VF for submit@debbugs.gnu.org; Sun, 15 Sep 2013 04:22:22 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35940) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VL7aw-0006DT-M3 for bug-gnu-emacs@gnu.org; Sun, 15 Sep 2013 04:22:22 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VL7ao-0005tM-JX for bug-gnu-emacs@gnu.org; Sun, 15 Sep 2013 04:22:14 -0400 Received: from nctlincom01.orcon.net.nz ([60.234.4.69]:53736) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VL7an-0005r3-Tj for bug-gnu-emacs@gnu.org; Sun, 15 Sep 2013 04:22:06 -0400 Received: from mx7.orcon.net.nz (mx7.orcon.net.nz [219.88.242.57]) by nctlincom01.orcon.net.nz (8.14.3/8.14.3/Debian-9.4) with ESMTP id r8F8Oqqh028334 for ; Sun, 15 Sep 2013 20:24:52 +1200 Received: from Debian-exim by mx7.orcon.net.nz with local (Exim 4.69) (envelope-from ) id 1VL7aV-0002W7-2U for bug-gnu-emacs@gnu.org; Sun, 15 Sep 2013 20:21:47 +1200 Received: from [121.99.86.188] (helo=[10.1.1.3]) by mx7.orcon.net.nz with esmtpa (Exim 4.69) (envelope-from ) id 1VL7aU-0002Vp-T2 for bug-gnu-emacs@gnu.org; Sun, 15 Sep 2013 20:21:46 +1200 Message-ID: <52356E11.6080401@orcon.net.nz> Date: Sun, 15 Sep 2013 20:21:37 +1200 From: Phil Sainty User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:17.0) Gecko/20130801 Thunderbird/17.0.8 MIME-Version: 1.0 To: bug-gnu-emacs@gnu.org Subject: 24.3; NTEmacs write-region behaviour with MUSTBENEW set to 'excl Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-DSPAM-Check: by mx7.orcon.net.nz on Sun, 15 Sep 2013 20:21:46 +1200 X-DSPAM-Result: Spam X-DSPAM-Processed: Sun Sep 15 20:21:47 2013 X-DSPAM-Confidence: 0.5043 X-DSPAM-Probability: 0.9799 X-Bayes-Prob: 0.0001 (Score 0, tokens from: @@RPTN, default) X-CanIt-Geo: ip=121.99.86.188; country=NZ; region=E7; city=Auckland; latitude=-36.8667; longitude=174.7667; http://maps.google.com/maps?q=-36.8667,174.7667&z=6 X-CanItPRO-Stream: base:default X-Canit-Stats-ID: 06KpkoQQn - ab5bb186b41b - 20130915 X-Scanned-By: CanIt (www . roaringpenguin . com) on 172.16.100.174 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) I'm using write-region with the MUSTBENEW argument set to 'excl to prohibit writing to an existing file. This works as advertised on Ubuntu, but I happened to try the code under Windows and found that the write was not prevented. I further observed that, in this circumstance, the written content only overwrites the start of the target file (leaving the remainder), rather than replacing the whole file. This appears to be the same behaviour as setting the APPEND argument to zero. Setting MUSTBENEW to t works as expected. I'm using the following to test: M-: (write-region (region-beginning) (region-end) "~/somefile" nil nil nil 'excl) RET In GNU Emacs 24.3.1 (i386-mingw-nt5.1.2600) of 2013-03-18 on MARVIN Windowing system distributor `Microsoft Corp.', version 5.1.2600 Configured using: `configure --with-gcc (4.7) --cflags -ID:/devel/emacs/libs/libXpm-3.5.8/include -ID:/devel/emacs/libs/libXpm-3.5.8/src -ID:/devel/emacs/libs/libpng-dev_1.4.3-1/include -ID:/devel/emacs/libs/zlib-dev_1.2.5-2/include -ID:/devel/emacs/libs/giflib-4.1.4-1/include -ID:/devel/emacs/libs/jpeg-6b-4/include -ID:/devel/emacs/libs/tiff-3.8.2-1/include -ID:/devel/emacs/libs/gnutls-3.0.9/include -ID:/devel/emacs/libs/libiconv-1.13.1-1-dev/include -ID:/devel/emacs/libs/libxml2-2.7.8/include/libxml2' Important settings: value of $LANG: ENZ locale-coding-system: cp1252 default enable-multibyte-characters: t Major mode: Lisp Interaction Minor modes in effect: tooltip-mode: t mouse-wheel-mode: t tool-bar-mode: t menu-bar-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t blink-cursor-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t line-number-mode: t transient-mark-mode: t Recent input: M-x r e p o r t Recent messages: For information about GNU Emacs and the GNU system, type C-h C-a. call-interactively: End of buffer Load-path shadows: None found. Features: (shadow sort gnus-util mail-extr emacsbug message format-spec rfc822 mml easymenu mml-sec mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums mm-util mail-prsvr mail-utils time-date tooltip ediff-hook vc-hooks lisp-float-type mwheel dos-w32 ls-lisp w32-common-fns disp-table w32-win w32-vars tool-bar dnd fontset image regexp-opt fringe tabulated-list newcomment lisp-mode register page menu-bar rfn-eshadow timer select scroll-bar mouse jit-lock font-lock syntax facemenu font-core frame cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese case-table epa-hook jka-cmpr-hook help simple abbrev minibuffer loaddefs button faces cus-face macroexp files text-properties overlay sha1 md5 base64 format env code-pages mule custom widget hashtable-print-readable backquote make-network-process w32 multi-tty emacs) From debbugs-submit-bounces@debbugs.gnu.org Sun Sep 15 05:47:05 2013 Received: (at 15381-done) by debbugs.gnu.org; 15 Sep 2013 09:47:05 +0000 Received: from localhost ([127.0.0.1]:38067 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VL8v2-0002xr-Nc for submit@debbugs.gnu.org; Sun, 15 Sep 2013 05:47:04 -0400 Received: from mtaout22.012.net.il ([80.179.55.172]:38716) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VL8uy-0002xG-Sm for 15381-done@debbugs.gnu.org; Sun, 15 Sep 2013 05:47:02 -0400 Received: from conversion-daemon.a-mtaout22.012.net.il by a-mtaout22.012.net.il (HyperSendmail v2007.08) id <0MT500L00V3YGK00@a-mtaout22.012.net.il> for 15381-done@debbugs.gnu.org; Sun, 15 Sep 2013 12:46:40 +0300 (IDT) Received: from HOME-C4E4A596F7 ([87.69.4.28]) by a-mtaout22.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0MT500L8DV5R5O60@a-mtaout22.012.net.il>; Sun, 15 Sep 2013 12:46:39 +0300 (IDT) Date: Sun, 15 Sep 2013 12:46:32 +0300 From: Eli Zaretskii Subject: Re: bug#15381: 24.3; NTEmacs write-region behaviour with MUSTBENEW set to 'excl In-reply-to: <52356E11.6080401@orcon.net.nz> X-012-Sender: halo1@inter.net.il To: Phil Sainty Message-id: <83eh8qqux3.fsf@gnu.org> References: <52356E11.6080401@orcon.net.nz> X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: 15381-done Cc: 15381-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: Eli Zaretskii List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 1.0 (+) > Date: Sun, 15 Sep 2013 20:21:37 +1200 > From: Phil Sainty > > I'm using write-region with the MUSTBENEW argument set to 'excl > to prohibit writing to an existing file. This works as advertised > on Ubuntu, but I happened to try the code under Windows and found > that the write was not prevented. > > I further observed that, in this circumstance, the written > content only overwrites the start of the target file (leaving > the remainder), rather than replacing the whole file. This > appears to be the same behaviour as setting the APPEND argument > to zero. > > Setting MUSTBENEW to t works as expected. > > I'm using the following to test: > > M-: (write-region (region-beginning) (region-end) "~/somefile" nil nil > nil 'excl) RET This is a known problem on Windows in all versions of Emacs released until now. The problem is already fixed in the development code. If you can build your own Emacs, I can show you the change that is required to fix the bug. Thanks. From debbugs-submit-bounces@debbugs.gnu.org Sun Sep 15 06:48:59 2013 Received: (at 15381-done) by debbugs.gnu.org; 15 Sep 2013 10:48:59 +0000 Received: from localhost ([127.0.0.1]:38172 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VL9sw-0004Xw-6P for submit@debbugs.gnu.org; Sun, 15 Sep 2013 06:48:58 -0400 Received: from nctlincom01.orcon.net.nz ([60.234.4.69]:58079) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VL9ss-0004Xl-1D for 15381-done@debbugs.gnu.org; Sun, 15 Sep 2013 06:48:55 -0400 Received: from mx5.orcon.net.nz (mx5.orcon.net.nz [219.88.242.55]) by nctlincom01.orcon.net.nz (8.14.3/8.14.3/Debian-9.4) with ESMTP id r8FApudl019395 for <15381-done@debbugs.gnu.org>; Sun, 15 Sep 2013 22:51:56 +1200 Received: from Debian-exim by mx5.orcon.net.nz with local (Exim 4.69) (envelope-from ) id 1VL9so-0007Uw-2K for 15381-done@debbugs.gnu.org; Sun, 15 Sep 2013 22:48:50 +1200 Received: from [121.99.86.188] (helo=[10.1.1.3]) by mx5.orcon.net.nz with esmtpa (Exim 4.69) (envelope-from ) id 1VL9sn-0007Ud-U1; Sun, 15 Sep 2013 22:48:49 +1200 Message-ID: <52359088.8020900@orcon.net.nz> Date: Sun, 15 Sep 2013 22:48:40 +1200 From: Phil Sainty User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:17.0) Gecko/20130801 Thunderbird/17.0.8 MIME-Version: 1.0 To: Eli Zaretskii Subject: Re: bug#15381: 24.3; NTEmacs write-region behaviour with MUSTBENEW set to 'excl References: <52356E11.6080401@orcon.net.nz> <83eh8qqux3.fsf@gnu.org> In-Reply-To: <83eh8qqux3.fsf@gnu.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-DSPAM-Check: by mx5.orcon.net.nz on Sun, 15 Sep 2013 22:48:49 +1200 X-DSPAM-Result: Innocent X-DSPAM-Processed: Sun Sep 15 22:48:50 2013 X-DSPAM-Confidence: 0.5225 X-DSPAM-Probability: 0.0055 X-Bayes-Prob: 0.0001 (Score 0, tokens from: @@RPTN, default) X-Spam-Score: -3.00 () [Hold at 4.00] CC(NZ:-3) X-CanIt-Geo: ip=121.99.86.188; country=NZ; region=E7; city=Auckland; latitude=-36.8667; longitude=174.7667; http://maps.google.com/maps?q=-36.8667,174.7667&z=6 X-CanItPRO-Stream: base:default X-Canit-Stats-ID: 06KpmPU22 - 189ec7a7e85a - 20130915 X-Scanned-By: CanIt (www . roaringpenguin . com) on 172.16.100.174 X-Spam-Score: -0.9 (/) X-Debbugs-Envelope-To: 15381-done Cc: 15381-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.9 (/) On 15/09/2013 21:46, Eli Zaretskii wrote: > This is a known problem on Windows in all versions of Emacs released > until now. The problem is already fixed in the development code. Excellent, thank you. > If you can build your own Emacs, I can show you the change that is > required to fix the bug. No, I haven't built Emacs on Windows before, but I also don't use it enough on that platform to be worried about getting the fix early. cheers, -Phil From unknown Sat Jun 14 04:54:08 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Sun, 13 Oct 2013 11:24:04 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator