Included functionality to describe the document in the input file
[biaweb2.git] / biawebutil.hpp
index ee6cd5a..6a87827 100644 (file)
@@ -23,16 +23,18 @@ namespace biaweb {
         // till a cleaner solution can be found. 
         MMIOT *doc;
         doc = mkd_string (str.c_str(), str.size(), 0);
-        FILE *f = fopen (".biaweb.tmp", "w");
+        char tempfile[20];
+        strcpy (tempfile, "/tmp/biawebXXXXXX");
+        mkstemp (tempfile);
+        FILE *f = fopen (tempfile, "w");
         markdown (doc, f, 0);
         fclose (f);
-        std::ifstream ftmp (".biaweb.tmp");
+        std::ifstream ftmp (tempfile);
         std::string tmpl ( (std::istreambuf_iterator<char> (ftmp)),
                             (std::istreambuf_iterator<char> ())
                                 );
         ftmp.close ();
         mkd_cleanup (doc);
-        remove (".biaweb.tmp");
         return tmpl;
     }