SL-18837: NamedTempFile must be binary mode on Windows.

master
Nat Goodspeed 2023-09-08 09:50:38 -04:00
parent a45c9f68c3
commit eb84585875
1 changed files with 2 additions and 2 deletions

View File

@ -70,7 +70,7 @@ public:
void peep()
{
std::cout << "File '" << mPath << "' contains:\n";
boost::filesystem::ifstream reader(mPath);
boost::filesystem::ifstream reader(mPath, std::ios::binary);
std::string line;
while (std::getline(reader, line))
std::cout << line << '\n';
@ -103,7 +103,7 @@ protected:
{
// Create file in a temporary place.
mPath = temp_path(pfx, sfx);
boost::filesystem::ofstream out{ mPath };
boost::filesystem::ofstream out{ mPath, std::ios::binary };
// Write desired content.
func(out);
}