X-Git-Url: https://harishankar.org/repos/?p=biaweb2.git;a=blobdiff_plain;f=biawebutil.hpp;h=6a878271b40e20bb4a0e6df4cb2da876884f9881;hp=ee6cd5a26e4e0771524ba2e24961d1768fc4179c;hb=26b38b4a38c24955293a7144f1e1d74676601caf;hpb=fe9a0fef0b31ee3b94b3e73b7e319087a49a3054 diff --git a/biawebutil.hpp b/biawebutil.hpp index ee6cd5a..6a87827 100644 --- a/biawebutil.hpp +++ b/biawebutil.hpp @@ -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 (ftmp)), (std::istreambuf_iterator ()) ); ftmp.close (); mkd_cleanup (doc); - remove (".biaweb.tmp"); return tmpl; }