]> www.ginac.de Git - ginac.git/commitdiff
[DOC] Suggest ios::binary flag for archiving files.
authorVladimir V. Kisil <kisilv@maths.leeds.ac.uk>
Sun, 9 Jun 2019 16:36:49 +0000 (18:36 +0200)
committerRichard Kreckel <kreckel@ginac.de>
Sun, 9 Jun 2019 16:36:49 +0000 (18:36 +0200)
Without the flag locales setting of the OS tempers the file structure.

Signed-off-by: Vladimir V. Kisil <kisilv@maths.leeds.ac.uk>
doc/tutorial/ginac.texi

index 331c21254fff79e0ab1df7f23a375d0420c910e4..bc4b87fc0a65eca8b8290782f4bb8e33a7de5bec 100644 (file)
@@ -6743,14 +6743,16 @@ The archive can then be written to a file:
 
 @example
     // ...
 
 @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
     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
 
 @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;
 @example
     // ...
     archive a2;
-    ifstream in("foobar.gar");
+    ifstream in("foobar.gar", ios::binary);
     in >> a2;
     // ...
 @end example
     in >> a2;
     // ...
 @end example