mirror of
https://github.com/davisking/dlib.git
synced 2024-11-01 10:14:53 +08:00
The new serialization API that works like serialize("filename") << object; wasn't
opening files in binary mode. Oops. This is now fixed.
This commit is contained in:
parent
165f9ef1f8
commit
9d00aa54cb
@ -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.");
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user