[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Octave-bug-tracker] [bug #33456] Function handles save()ed with "-binar
From: |
Olaf Till |
Subject: |
[Octave-bug-tracker] [bug #33456] Function handles save()ed with "-binary" can't always be re-load()ed |
Date: |
Thu, 02 Jun 2011 14:57:39 +0000 |
User-agent: |
Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.16) Gecko/20110429 Iceweasel/3.5.16 (like Firefox/3.5.16) |
Follow-up Comment #2, bug #33456 (project octave):
The reason is that the "load_binary()" function of function-handles uses
std::istream::get(). I din't find it documented, but according to a test
"stream.get (char *c, int n)" or "stream.get (char *c, int n, char b)", though
loading n - 1 bytes into c as expected, cause stream.eof() to be true if the
last read byte was the last byte of the file (i.e. _without_ any trying to
read over the file end --- weird). Luckily function-handles seem to be the
only octave_values which use std::istream::get() in load_binary().
A changeset is attached which should fix this.
(file #23495)
_______________________________________________________
Additional Item Attachment:
File name: fcn-handle-load-binary.changeset Size:1 KB
_______________________________________________________
Reply to this item at:
<http://savannah.gnu.org/bugs/?33456>
_______________________________________________
Message sent via/by Savannah
http://savannah.gnu.org/