Skip to content
Prev 16909 / 63424 Next

Sweave resource leak: leftover temp files (PR#7998)

On 7/12/2005 8:58 AM, Prof Brian Ripley wrote:
This is documented in the API call DeleteFile.  I wouldn't call MSVCRT 
part of Windows, but I guess this is the same thing as saying that Linux 
is the kernel, not the whole collection of things you get in a Linux 
distribution.

Windows provides a different mechanism for this, the 
FILE_FLAG_DELETE_ON_CLOSE flag to CreateFile().  Your patch has solved 
the problem, so I can't see that it would be worthwhile using this, but 
one way to implement the POSIX behaviour would be to open a file with 
this flag, then immediately close it.  As long as all other handles to 
the file are eventually closed the file should be deleted.

Duncan