[Top][All Lists]

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

Re: [wdiff-bugs] [bug #36546] error executing diff results in undeleted

From: Martin von Gagern
Subject: Re: [wdiff-bugs] [bug #36546] error executing diff results in undeleted temporary files
Date: Mon, 28 May 2012 21:52:56 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:12.0) Gecko/20120524 Thunderbird/12.0.1

Hi Nelson,

thanks for your input.

On 28.05.2012 15:29, Nelson H. F. Beebe wrote:
>>> http://savannah.gnu.org/bugs/?36546
> 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
support that?

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.


Attachment: signature.asc
Description: OpenPGP digital signature

reply via email to

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