
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}

Matt Doyle wrote:
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..
But then you have to carefully craft the spec, as users may expect to be able to share the file (by name) among processes. There are clearly different use cases for temporary files, so it is important to capture the most important ones. Regards, Stefan

I think the most important case involves a completely opaque temp file. You can perform stream operations on it and share it within a process but have no access to the filesystem specific information (i.e. its filename). Agree or disagree? Dylan Stefan Seefeld wrote:
Matt Doyle wrote:
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..
But then you have to carefully craft the spec, as users may expect to be able to share the file (by name) among processes. There are clearly different use cases for temporary files, so it is important to capture the most important ones.
Regards, Stefan
_______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost

Dylan Trotter wrote:
I think the most important case involves a completely opaque temp file. You can perform stream operations on it and share it within a process but have no access to the filesystem specific information (i.e. its filename).
Agree or disagree?
I'm not sure about the ordering according to importance. It doesn't matter which is more important, as long as they are all supported (where 'all' is may be three or four different scenarios). Regards, Stefan

-----Original Message----- From: boost-bounces@lists.boost.org [mailto:boost-bounces@lists.boost.org] On Behalf Of Stefan Seefeld Sent: Friday, September 09, 2005 1:38 PM To: boost@lists.boost.org Subject: Re: [boost] temp file
Dylan Trotter wrote:
I think the most important case involves a completely opaque temp file. You can perform stream operations on it and share it within a process but have no access to the filesystem specific information (i.e. its filename).
Agree or disagree?
I'm not sure about the ordering according to importance. It doesn't matter which is more important, as long as they are all supported (where 'all' is may be three or four different scenarios).
Regards, Stefan
I agree with Stefan. I guess, there isn't enough information (and possibly will never) to rank the use cases. For example, in my case, having a temp file in the file system is the most useful case as I need to transfer temp files across processes. --Suman
_______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost

Stefan Seefeld wrote:
Dylan Trotter wrote:
I think the most important case involves a completely opaque temp file. You can perform stream operations on it and share it within a process but have no access to the filesystem specific information (i.e. its filename).
Agree or disagree?
I'm not sure about the ordering according to importance. It doesn't matter which is more important, as long as they are all supported (where 'all' is may be three or four different scenarios).
Fair enough. However, I didn't intend to suggest that other scenarios be ignored, only that the indicated scenario is a common one around which an implementation might be planned. In any case I'm more interested in hearing other use cases. So to rephrase: Other suggestions?
Regards, Stefan _______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
participants (4)
-
Dylan Trotter
-
Matt Doyle
-
Stefan Seefeld
-
Suman Cherukuri