_annc_filename.append (VERSIONSTRING);
std::string path = Glib::build_filename (user_config_directory(), _annc_filename);
- std::ifstream announce_file (path.c_str());
- if ( announce_file.fail() )
- _announce_string = "";
- else {
- std::stringstream oss;
- oss << announce_file.rdbuf();
- _announce_string = oss.str();
+ FILE* fin = g_fopen (path.c_str(), "rb");
+
+ if (fin) {
+ std::ifstream announce_file (fin);
+
+ if ( announce_file.fail() )
+ _announce_string = "";
+ else {
+ std::stringstream oss;
+ oss << announce_file.rdbuf();
+ _announce_string = oss.str();
+ }
+
+ fclose (fin);
}
pingback (VERSIONSTRING, path);
#include <curl/curl.h>
+#include <glib/gstdio.h>
#include <glibmm/miscutils.h>
#include "pbd/compose.h"
//write announcements to local file, even if the
//announcement is empty
-
- std::ofstream annc_file (cm->announce_path.c_str());
-
- if (annc_file) {
- annc_file << return_str;
+
+ FILE* fout = g_fopen (cm->announce_path.c_str(), "wb");
+
+ if (fout) {
+ {
+ std::ofstream annc_file (fout);
+
+ if (annc_file) {
+ annc_file << return_str;
+ }
+ }
+
+ fclose (fout);
}
}
} else {