[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [wdiff-bugs] [bug #36546] error executing diff results in undeleted
Martin von Gagern
Re: [wdiff-bugs] [bug #36546] error executing diff results in undeleted temporary files
Mon, 28 May 2012 21:52:56 +0200
Mozilla/5.0 (X11; Linux x86_64; rv:12.0) Gecko/20120524 Thunderbird/12.0.1
thanks for your input.
On 28.05.2012 15:29, Nelson H. F. Beebe wrote:
> A common approach in Unix software to ensure deletion of temporary
> files in the event of premature job termination is to issue an
> unlink() call immediately after a successful open. There is then no
> need for special atexit() processing to cleanup, except on some
> non-Unix systems with filesystems that do not support unlink().
For temporary files used only for internal caching, wdiff already
employs this approach. But the files in question are those handed over
to the diff process as command line arguments. I'm not sure whether
unlinking the inodes and passing the files as descriptors using
/dev/fd/* is sufficiently portable. Do you know which platforms do
There is some other code executed upon termination from a signal handler
as well, besides unlinking of files. Most notable among these is some
code waiting for the pager to terminate. But perhaps executing that code
during exceptional program termination might even be undesirable and
thus considered a bug in its own right.
Description: OpenPGP digital signature