Subject: Re: [Boost-bugs] [Boost C++ Libraries] #590: mkstemp
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2009-07-03 19:36:02
#590: mkstemp
-------------------------------+--------------------------------------------
Reporter: nobody | Owner: bemandawes
Type: Feature Requests | Status: assigned
Milestone: To Be Determined | Component: filesystem
Version: None | Severity: Not Applicable
Resolution: None | Keywords:
-------------------------------+--------------------------------------------
Comment(by andysem):
Not sure if this applies to this ticket, but I've been in need of temp
files support many times, too. So here are my thoughts.
Maybe, on the low level, such functionality could be reached through
fstreams extension: if it was possible to construct fstream from FILE*
then the tmpfile function could be used to create temporary files. On the
higher level a wrapper function could be provided, such as:
{{{
void open_temp_file(fstream& strm);
}}}
The function would internally call tmpfile or whatever other API to create
the file and attach it to the stream.
Scoped files, while they look appealing for some cases, are limiting when
the lifetime of the stream has to span across scopes. A simple wrapper
derived from the fstream and on top of open_temp_file can be provided, but
it should not be the only way to do it.
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/590#comment:5> Boost C++ Libraries <http://www.boost.org/> Boost provides free peer-reviewed portable C++ source libraries.
This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:00 UTC