Boost logo

Boost :

From: Matt Doyle (mdoyle_at_[hidden])
Date: 2005-09-09 15:00:08


> I didn't know about that, because on win32 there is a problem with
> deleting open files.

Using the WIN32 call CreateFile specify FILE_ATTRIBUTE_TEMPORARY.

from MSDN -> FILE_ATTRIBUTE_TEMPORARY - A file is being used for temporary storage. File systems avoid writing data back to mass storage if sufficient cache memory is available, because an application deletes a temporary file after a handle is closed. In that case, the system can entirely avoid writing the data. Otherwise, the data is written after the handle is closed.

You still can't delete an open file but you can possibly avoid ever creating the file in the first place..

Matt

> On unix systems (probably most or all of them)
> you can delete file and when last handle is closed kernel
> automatically
> removes file - it's great solution.
>
> Anyway, same people on unix (in same cases) first open temp file,
> then remove it and then use it - no one could do anything
> with your file.
>
> Tom
<<snip>>

Scanned by Fortigate {X3BTB534}


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk