help-octave
[Top][All Lists]
Advanced

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

Re: Reading binary file


From: MrOba
Subject: Re: Reading binary file
Date: Mon, 17 Jun 2013 01:17:53 -0700 (PDT)

This is what I do..
>From octave:

octave:46> a = [[1,5];[6,8]]
a =

   1   5
   6   8

octave:47> save -binary data.bin a

This save a file in binary format. I can load the file in octave without
problem.
I have then some c++ code to try to read the binary file that is almost the
same from octave_file_io.cc from http://wiki.octave.org/Fortran. 

I changed load_save_format format = LS_ASCII to load_save_format format =
LS_BINARY;
do_load is then calling read_binary_data from ls_oct_binary.cc and here the
code 

  if (!tc.load_binary (is, swap, fmt))
    {
    data_read_error:
      error ("load: trouble reading binary file `%s'", filename.c_str ());
    }

I checked the file pointer, set it to a fullpath, and tested the binary
file..
Any other suggestion?

Regard
MrO




--
View this message in context: 
http://octave.1599824.n4.nabble.com/Reading-binary-file-tp4653959p4654347.html
Sent from the Octave - General mailing list archive at Nabble.com.


reply via email to

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