// 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");
+ int fd = mkstemp (tempfile);
+ FILE *f = fdopen (fd, "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");
+ remove (tempfile);
return tmpl;
}