From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: Fixing parallel byte-compilation Date: Mon, 13 Sep 2010 19:10:15 +0200 Message-ID: <83d3sh4ljc.fsf@gnu.org> References: <80occ5xilc.fsf@fencepost.gnu.org> <47537.130.55.118.19.1284395601.squirrel@webmail.lanl.gov> Reply-To: Eli Zaretskii NNTP-Posting-Host: lo.gmane.org X-Trace: dough.gmane.org 1284397839 30723 80.91.229.12 (13 Sep 2010 17:10:39 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 13 Sep 2010 17:10:39 +0000 (UTC) Cc: emacs-devel@gnu.org To: herring@lanl.gov Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Sep 13 19:10:38 2010 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1OvCYA-0007AC-6q for ged-emacs-devel@m.gmane.org; Mon, 13 Sep 2010 19:10:38 +0200 Original-Received: from localhost ([127.0.0.1]:37687 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OvCY9-0007m0-EU for ged-emacs-devel@m.gmane.org; Mon, 13 Sep 2010 13:10:37 -0400 Original-Received: from [140.186.70.92] (port=33448 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OvCY0-0007kG-D3 for emacs-devel@gnu.org; Mon, 13 Sep 2010 13:10:29 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OvCXz-0005Ph-6V for emacs-devel@gnu.org; Mon, 13 Sep 2010 13:10:28 -0400 Original-Received: from mtaout20.012.net.il ([80.179.55.166]:33379) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OvCXy-0005Pb-V3; Mon, 13 Sep 2010 13:10:27 -0400 Original-Received: from conversion-daemon.a-mtaout20.012.net.il by a-mtaout20.012.net.il (HyperSendmail v2007.08) id <0L8P008003OMLO00@a-mtaout20.012.net.il>; Mon, 13 Sep 2010 19:10:16 +0200 (IST) Original-Received: from HOME-C4E4A596F7 ([77.127.81.53]) by a-mtaout20.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0L8P008JB3P2KY10@a-mtaout20.012.net.il>; Mon, 13 Sep 2010 19:10:15 +0200 (IST) In-reply-to: <47537.130.55.118.19.1284395601.squirrel@webmail.lanl.gov> X-012-Sender: halo1@inter.net.il X-detected-operating-system: by eggs.gnu.org: Solaris 10 (beta) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:130072 Archived-At: > Date: Mon, 13 Sep 2010 09:33:21 -0700 (PDT) > From: "Davis Herring" > Cc: emacs-devel@gnu.org > > > ! ;; The old code used to: delete target-file before > > ! ;; writing it, so that any hard-links continue to > > ! ;; point to the old file (this makes it possible > > ! ;; for installed files to share disk space with > > ! ;; the build tree, without causing problems when > > ! ;; emacs-lisp files in the build tree are > > ! ;; recompiled). Renaming works the same way. > > ! (write-region (point-min) (point-max) tempfile) > > ! (rename-file tempfile target-file t)) > > Does `rename-file' work outside of POSIX (that is, on Windows) if the > target file exists? Not for free, but it does. Windows has sys_rename, which see in w32.c, while the DOS build uses a standard C library whose `rename' does that under the hood. Of course, this could still fail if the target is open by some other program, but the old code uses delete-file which would fail in that case as well. So we didn't make the situation worse than it was already.