Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r55725 - sandbox/boost/mapreduce
From: cdm.henderson_at_[hidden]
Date: 2009-08-22 17:44:58


Author: chenderson
Date: 2009-08-22 17:44:58 EDT (Sat, 22 Aug 2009)
New Revision: 55725
URL: http://svn.boost.org/trac/boost/changeset/55725

Log:
GNU get_temporary_filename() implemented
Text files modified:
   sandbox/boost/mapreduce/platform.hpp | 13 ++++++++++++-
   1 files changed, 12 insertions(+), 1 deletions(-)

Modified: sandbox/boost/mapreduce/platform.hpp
==============================================================================
--- sandbox/boost/mapreduce/platform.hpp (original)
+++ sandbox/boost/mapreduce/platform.hpp 2009-08-22 17:44:58 EDT (Sat, 22 Aug 2009)
@@ -24,6 +24,10 @@
 #undef max
 #endif
 
+#ifdef __GNUC__
+#include <cstdlib>
+#endif
+
 namespace boost {
 
 namespace mapreduce {
@@ -88,7 +92,14 @@
 
 namespace linux_os {
 
-std::string &get_temporary_filename(std::string &pathname); // !!! not implemented
+std::string get_temporary_filename(std::string &pathname)
+{
+ const std::string tmp = "/tmp/XXXXXX";
+ char* tmpfile = const_cast<char*>(tmp.c_str());
+ mkstemp(tmpfile);
+ std::string res(tmpfile);
+ return res;
+}
 
 #endif
 


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk