From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Phil Sainty Newsgroups: gmane.emacs.bugs Subject: bug#15381: 24.3; NTEmacs write-region behaviour with MUSTBENEW set to 'excl Date: Sun, 15 Sep 2013 20:21:37 +1200 Message-ID: <52356E11.6080401@orcon.net.nz> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1379233406 440 80.91.229.3 (15 Sep 2013 08:23:26 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 15 Sep 2013 08:23:26 +0000 (UTC) To: 15381@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Sep 15 10:23:28 2013 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1VL7c6-0007gm-Cx for geb-bug-gnu-emacs@m.gmane.org; Sun, 15 Sep 2013 10:23:26 +0200 Original-Received: from localhost ([::1]:55808 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VL7c5-0006HK-Ka for geb-bug-gnu-emacs@m.gmane.org; Sun, 15 Sep 2013 04:23:25 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:36045) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VL7bt-0006GF-CO for bug-gnu-emacs@gnu.org; Sun, 15 Sep 2013 04:23:23 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VL7bj-0006K3-HM for bug-gnu-emacs@gnu.org; Sun, 15 Sep 2013 04:23:13 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:57945) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VL7bj-0006Jx-DS for bug-gnu-emacs@gnu.org; Sun, 15 Sep 2013 04:23:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1VL7bi-0000tN-PU for bug-gnu-emacs@gnu.org; Sun, 15 Sep 2013 04:23:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Phil Sainty Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 15 Sep 2013 08:23:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 15381 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.13792333613390 (code B ref -1); Sun, 15 Sep 2013 08:23:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 15 Sep 2013 08:22:41 +0000 Original-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 Original-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 Original-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 Original-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 Original-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 Original-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 Original-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 Original-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 Original-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 Original-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 User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:17.0) Gecko/20130801 Thunderbird/17.0.8 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-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:78417 Archived-At: 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)