Return-Path: X-Original-To: notmuch@notmuchmail.org Delivered-To: notmuch@notmuchmail.org Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id E8CA140DDE8 for ; Tue, 16 Nov 2010 07:38:38 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: -1.899 X-Spam-Level: X-Spam-Status: No, score=-1.899 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, UNPARSEABLE_RELAY=0.001] autolearn=ham Received: from olra.theworths.org ([127.0.0.1]) by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id DUbvA2G6VZ2W for ; Tue, 16 Nov 2010 07:38:28 -0800 (PST) Received: from rodolpho.mayfirst.org (rodolpho.mayfirst.org [209.234.253.107]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by olra.theworths.org (Postfix) with ESMTPS id B04C540DDD2 for ; Tue, 16 Nov 2010 07:38:28 -0800 (PST) Received: from localhost (localhost [127.0.0.1]) by rodolpho.mayfirst.org (Postfix) with ESMTP id 33A1D3CD43; Tue, 16 Nov 2010 10:38:25 -0500 (EST) X-Virus-Scanned: Debian amavisd-new at rodolpho.mayfirst.org Received: from rodolpho.mayfirst.org ([127.0.0.1]) by localhost (rodolpho.mayfirst.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id peyjHJMCmi7p; Tue, 16 Nov 2010 10:38:25 -0500 (EST) Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: smtpauth@rodolpho.mayfirst.org) with ESMTPSA id E80F33CD3F Message-ID: <4CE2A56C.4080407@fifthhorseman.net> Date: Tue, 16 Nov 2010 10:38:20 -0500 From: Daniel Kahn Gillmor User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.9) Gecko/20100918 Icedove/3.1.4 MIME-Version: 1.0 To: Jameson Rollins Subject: Re: `notmuch setup` replaces `~/.notmuch-config` instead of truncating it References: <87k4kdbd77.fsf@servo.finestructure.net> In-Reply-To: <87k4kdbd77.fsf@servo.finestructure.net> X-Enigmail-Version: 1.1.2 OpenPGP: id=D21739E9 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="------------enigDF1821FCF2936D02073A5588" Cc: notmuch@notmuchmail.org X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.13 Precedence: list Reply-To: notmuch List-Id: "Use and development of the notmuch mail system." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Nov 2010 15:38:39 -0000 This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enigDF1821FCF2936D02073A5588 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 11/16/2010 08:38 AM, Jameson Rollins wrote: > On Tue, 16 Nov 2010 15:33:30 +0200, "Ciprian Dorin, Craciun" wrote: >> So my question is: is this behaviour (of deleting the file and >> creating a new one) deliberate? If not, could it be fixed (I could >> provide a patch) to just update the file in place? >=20 > Hi, Ciprian. I had not noticed this, but now that you mention it, I se= e > that the same thing happened to me. This behavior is surely not > deliberate, and is definitely undesirable. A patch would be welcome. It often is desirable to do a replacement instead of truncation or appending -- atomic replacement guarantees that a legitimate copy is always available. It eliminates a window of time when the config file would be in an intermediate state. Readers of the file always get either the old state or the new state -- nothing in between. However, you can address both concerns by detecting whether ~/.notmuch-config is a symlink and readlink()ing until you get to the underlying file. Then atomically replace the target instead of the symlink itself. --dkg --------------enigDF1821FCF2936D02073A5588 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iQIcBAEBCgAGBQJM4qVsAAoJEMzS7ZTSFznpJGwP/iRJrSqiBqbLySatymxduZ43 M+E3c1EceP0CF9YcbHkR52pfJOC8CC/Cnr37TIMzHniM4Jh5HN+J/QiMop83gIZx uWZdxctPWNHKOamf0uq26heyjXfC7I7dqgwnIeC1Tg6s3neFDGvfEd5Xeb4a1eUR 3sttap+LJVFx2J8akISoSsLpZchN4sF7+4WeEee813qKCMJTAWiJF9rPp/s6+F9z axdrd1gkMTLrYBl3i2OVfUY4p51wkfGuF6OG7GG111fdh11a5ptKTnqkC3yKivGO QFohfnRomo7xrda8MDtl3Ms7v5689XLJw01RubsQhEFrowHIyg+gtkU8GrM/iysq vv+zHAnU6hd7ZNCC9D38C3Wt1c0BcuQKW4XINlUob0cFNDU8EnQC1erypM+HGVu7 gq0mOH37d4IsDx2Z+p3S1N9XSZDQAbl1P1j9nxplpraA+r2WDQhuC5H5qxkj+ovG aUwMln6uTHr8x+n3QunNDEo56Xf+CQqHiBM2St/M+b39Ppl12FNNXFDJuH57hrA5 kLvEAjV+CLQJN0c2jMQeHT9tKopG5nDCyvTdjZqkf7HmP3l0WRIXwOKV6alJEKfN JQynPVhfHgWgHADg9gAARw+D81bjY4x1V5DyRUFmQfA4N20p+R+eC/Q0vIsgxajJ h2vcJBC2Ca3BJ3EAZ9QT =6Dao -----END PGP SIGNATURE----- --------------enigDF1821FCF2936D02073A5588--