From d0c8e8408c0eb669dc3d314b675ee8dd0f56c8f4 Mon Sep 17 00:00:00 2001 From: "Vladimir V. Kisil" Date: Sun, 9 Jun 2019 18:36:49 +0200 Subject: [PATCH] [DOC] Suggest ios::binary flag for archiving files. Without the flag locales setting of the OS tempers the file structure. Signed-off-by: Vladimir V. Kisil --- doc/tutorial/ginac.texi | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/doc/tutorial/ginac.texi b/doc/tutorial/ginac.texi index 331c2125..bc4b87fc 100644 --- a/doc/tutorial/ginac.texi +++ b/doc/tutorial/ginac.texi @@ -6743,14 +6743,16 @@ The archive can then be written to a file: @example // ... - ofstream out("foobar.gar"); + ofstream out("foobar.gar", ios::binary); out << a; out.close(); // ... @end example The file @file{foobar.gar} contains all information that is needed to -reconstruct the expressions @code{foo} and @code{bar}. +reconstruct the expressions @code{foo} and @code{bar}. The flag +@code{ios::binary} prevents locales setting of your OS tampers the +archive file structure. @cindex @command{viewgar} The tool @command{viewgar} that comes with GiNaC can be used to view @@ -6768,7 +6770,7 @@ read in again: @example // ... archive a2; - ifstream in("foobar.gar"); + ifstream in("foobar.gar", ios::binary); in >> a2; // ... @end example -- 2.44.0