[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Save function should check output file
From: |
Marco Mattiolo |
Subject: |
Save function should check output file |
Date: |
Thu, 29 Aug 2013 14:36:25 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130801 Thunderbird/17.0.8 |
Hi, and thank you all for writing/maintaining/supporting Octave!
I've had a problem with the "save" function: after extracting results
from a FEMM
simulation (using OctaveFemm commands inside a script), variables were:
Variables in the current scope:
Attr Name Size Bytes Class
==== ==== ==== ===== =====
out 3732445x14 418033840 double
x 1x3732445 29859560 double
y 1x3732445 29859560 double
Total is 59719120 elements using 477752960 bytes
which were saved (at the end of the script) with "save dati.mat x y out" to
-rwxr-xr-x 1 marcus89 root 502M ago 29 04:05 dati.mat
I copied dati.mat to my home and tried loading it inside another Octave
session:
octave:3> load dati.mat
error: load: failed to load matrix constant
error: load: trouble reading ascii file 'dati.mat'
error: load: reading file dati.mat
octave:3> whos
Variables in the current scope:
Attr Name Size Bytes Class
==== ==== ==== ===== =====
x 1x3732445 29859560 double
y 1x3732445 29859560 double
Total is 7464890 elements using 59719120 bytes
Got back to first Octave session and tried saving again (all variables
in a file or one variable per file),
but getting empty files.
octave:2> save x.mat x
octave:3> exit
$ ls -lh
-rwxr-xr-x 1 marcus89 root 0 ago 29 14:19 x.mat
After a search in this list's archives, tried "cd" to my home directory
and then saving again ("save data"):
-rw-r--r-- 1 marcus89 marcus89 682M ago 29 13:02 data
-rwxr-xr-x 1 marcus89 marcus89 502M ago 29 04:05 dati.mat
This time variables were saved right:
octave:3> clear all
octave:4> load data
octave:5> whos
Variables in the current scope:
Attr Name Size Bytes Class
==== ==== ==== ===== =====
out 3732445x14 418033840 double
x 1x3732445 29859560 double
y 1x3732445 29859560 double
Total is 59719120 elements using 477752960 bytes
So, probably during script's runtime (~10-12h) something,
related to usb-key's partition on which Octave script and input files
were, has changed,
bringing to a wrong (unusable) output file and to the inability to save
variables (getting empty files).
These problems got solved moving to another directory (probably because
of the full write access?).
My question is: why doesn't Octave's save function complain, if it
doesn't have full writing access to the actual directory?
Or check validity of the output file?
Wouldn't it be better, more reliable?
Thank you
Marco Mattiolo
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- Save function should check output file,
Marco Mattiolo <=