octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #51158] save function corrupts text / binary f


From: Rik
Subject: [Octave-bug-tracker] [bug #51158] save function corrupts text / binary files when appending as binary / text respectively
Date: Sun, 4 Jun 2017 11:09:47 -0400 (EDT)
User-agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:53.0) Gecko/20100101 Firefox/53.0

Update of bug #51158 (project octave):

                Priority:              5 - Normal => 3 - Low                
                  Status:                    None => Confirmed              

    _______________________________________________________

Follow-up Comment #2:

I agree that it would be nicer to have a warning message and stop appending,
rather than corrupting the existing data file.

An easy way to check whether the file is an Octave binary data file is to look
for the special pattern 'Octave' at the beginning of the file.  In an m-file,
something like this would work


fid = fopen (filename, "rb");
sig = fread (fid, 6, "*uchar");
is_binary = strcmp (sig.', "Octave");


I think that may need to be converted to C++.


    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?51158>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]