Commit 9d00aa54 authored by Davis King's avatar Davis King

The new serialization API that works like serialize("filename") << object; wasn't

opening files in binary mode.  Oops.  This is now fixed.
parent 165f9ef1
......@@ -1290,7 +1290,7 @@ namespace dlib
const std::string& filename
)
{
fout.reset(new std::ofstream(filename.c_str()));
fout.reset(new std::ofstream(filename.c_str(), std::ios::binary));
if (!(*fout))
throw serialization_error("Unable to open " + filename + " for writing.");
}
......@@ -1313,7 +1313,7 @@ namespace dlib
const std::string& filename
)
{
fin.reset(new std::ifstream(filename.c_str()));
fin.reset(new std::ifstream(filename.c_str(), std::ios::binary));
if (!(*fin))
throw serialization_error("Unable to open " + filename + " for reading.");
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment