[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug-cppi] Re: [PATCH] Add new option --in-place

From: Jim Meyering
Subject: [bug-cppi] Re: [PATCH] Add new option --in-place
Date: Thu, 18 Mar 2010 20:38:41 +0100

Hi Giuseppe,

Thanks for the heads-up about your post.


You seem to have sent that before I subscribed to the list I'd created.
Sorry I missed it:

Quick comments:

I'm not sure this is worth doing, but if it is you'll have
to make a few changes:

  - detect any write failure (i.e, don't omit checks for close failure)
  - the replacement must be atomic, which means the temporary
      file must be on the same file system as the destination (usually
      in the same directory), and the final operation is a rename
  - upon interrupt, the temporary file must be removed
  - also report any unlink failure
  - handle fclose failure, too -- use gnulib's close_stream function

I hesitated to enumerate that list (may well be incomplete),
because I don't want to give the impression that once you fix
everything it will be acceptable.

I'm really doubtful that adding the required complexity
is worthwhile.  Besides, isn't there a simple utility
program that can turn any filter program into an
operate-on-target-file-in-place utility?

reply via email to

[Prev in Thread] Current Thread [Next in Thread]