On Sep 15, 2005, Geoffrey Keating <[EMAIL PROTECTED]> wrote:

> On 14/09/2005, at 5:32 PM, Mike Stump wrote:

>> If you output to a temp file, and then mv them to the final file,
>> they will be (I think) safe.

> From the 'make' documentation, node 'Interrupts':

>> If `make' gets a fatal signal while a command is executing, it may
>> delete the target file that the command was supposed to update.
>> This is
>> done if the target file's last-modification time has changed since
>> `make' first checked it.

> So, I think this is safe.  The file will be deleted and then re-built
> next time you run 'make'.

That unfortunately doesn't cover power failures and so, which may
leave an incomplete file behind.  The use of a temp file has been the
right approach, recommended forever, and used all over the place in
the GCC build machinery.

-- 
Alexandre Oliva         http://www.lsd.ic.unicamp.br/~oliva/
Red Hat Compiler Engineer   [EMAIL PROTECTED], gcc.gnu.org}
Free Software Evangelist  [EMAIL PROTECTED], gnu.org}

Reply via email to