From: Vladimir V. Kisil Date: Sun, 9 Jun 2019 16:36:49 +0000 (+0200) Subject: [DOC] Suggest ios::binary flag for archiving files. X-Git-Tag: release_1-7-7~9 X-Git-Url: https://www.ginac.de/ginac.git//ginac.git?p=ginac.git;a=commitdiff_plain;h=d0c8e8408c0eb669dc3d314b675ee8dd0f56c8f4;ds=sidebyside [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 --- 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