[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Fixing parallel byte-compilation
From: |
Eli Zaretskii |
Subject: |
Re: Fixing parallel byte-compilation |
Date: |
Mon, 13 Sep 2010 19:10:15 +0200 |
> Date: Mon, 13 Sep 2010 09:33:21 -0700 (PDT)
> From: "Davis Herring" <address@hidden>
> Cc: address@hidden
>
> > ! ;; 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.