Opened 17 years ago
Closed 12 years ago
#590 closed Feature Requests (fixed)
mkstemp
Reported by: | nobody | Owned by: | Beman Dawes |
---|---|---|---|
Milestone: | To Be Determined | Component: | filesystem |
Version: | None | Severity: | Not Applicable |
Keywords: | Cc: | bdawes@… |
Description (last modified by )
Could you add a function similar to mkstemp in boost::filesystem? It would be interesting if it could receive an boost::filesystem::path or an std::string as input and return a ofstream and a path or a string as output jesus.malo@bsc.es
Change History (6)
comment:1 by , 15 years ago
Cc: | added |
---|---|
Component: | None → filesystem |
Description: | modified (diff) |
Severity: | → Showstopper |
comment:2 by , 15 years ago
Owner: | changed from | to
---|---|
Status: | assigned → new |
comment:3 by , 14 years ago
Severity: | Showstopper → Not Applicable |
---|
comment:4 by , 13 years ago
Milestone: | → To Be Determined |
---|---|
Status: | new → assigned |
No progress yet. Needs a design that abstracts away differences between POSIX and Windows. Contributions and/or suggestions welcome!
--Beman
comment:5 by , 13 years ago
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.
comment:6 by , 12 years ago
Resolution: | None → fixed |
---|---|
Status: | assigned → closed |
The unique_path() function in Version 3 addresses the problem. Version 3 will ship with 1.44.
Thanks,
--Beman
Can't reassign to Beman until he logs into Trac at http://svn.boost.org and sets his email address.