From 458404e22ba0161beb5e2da3b49063847964f44d Mon Sep 17 00:00:00 2001 From: Richard Kreckel Date: Wed, 9 Nov 2005 00:20:04 +0000 Subject: [PATCH] * Open streams binary (actually makes a difference on some exotic operating systems) (by Sheplyakov Alexei). --- check/exam_archive.cpp | 4 ++-- tools/viewgar.cpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/check/exam_archive.cpp b/check/exam_archive.cpp index 303192d0..e2e62615 100644 --- a/check/exam_archive.cpp +++ b/check/exam_archive.cpp @@ -54,12 +54,12 @@ unsigned exam_archive() archive ar; ar.archive_ex(e, "expr 1"); { - std::ofstream fout("exam.gar"); + std::ofstream fout("exam.gar", std::ios_base::binary); fout << ar; } ar.clear(); { - std::ifstream fin("exam.gar"); + std::ifstream fin("exam.gar", std::ios_base::binary); fin >> ar; } f = ar.unarchive_ex(lst(x, y, mu, dim), "expr 1"); diff --git a/tools/viewgar.cpp b/tools/viewgar.cpp index 93ca6049..dd169bdd 100644 --- a/tools/viewgar.cpp +++ b/tools/viewgar.cpp @@ -46,7 +46,7 @@ int main(int argc, char **argv) dump_mode = true; --argc; ++argv; } - std::ifstream f(*argv); + std::ifstream f(*argv, std::ios_base::binary); archive ar; f >> ar; if (dump_mode) { -- 2.45.0