unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: herring@lanl.gov
Cc: emacs-devel@gnu.org
Subject: Re: Fixing parallel byte-compilation
Date: Mon, 13 Sep 2010 19:10:15 +0200	[thread overview]
Message-ID: <83d3sh4ljc.fsf@gnu.org> (raw)
In-Reply-To: <47537.130.55.118.19.1284395601.squirrel@webmail.lanl.gov>

> Date: Mon, 13 Sep 2010 09:33:21 -0700 (PDT)
> From: "Davis Herring" <herring@lanl.gov>
> 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.



  reply	other threads:[~2010-09-13 17:10 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-09-10 23:51 Fixing parallel byte-compilation Glenn Morris
2010-09-10 23:56 ` Chad Brown
2010-09-11  0:52   ` Glenn Morris
2010-09-11 10:58 ` Stefan Monnier
2010-09-11 19:04   ` Glenn Morris
2010-09-12  9:50     ` Stefan Monnier
2010-09-13 16:33 ` Davis Herring
2010-09-13 17:10   ` Eli Zaretskii [this message]
2010-09-13 18:32     ` Glenn Morris

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=83d3sh4ljc.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=herring@lanl.gov \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).