Changeset 2628


Ignore:
Timestamp:
11/09/09 11:58:42 (15 years ago)
Author:
Mathieu Morlighem
Message:

Added test in load model: Check that the model is readable

File:
1 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk/src/m/utils/Model/loadmodel.m

    r2364 r2628  
    88%      loadmodel path
    99
    10 %some checks
     10%check nargout
    1111if nargout>1,
    1212        error('loadmodel usage error: md=loadmodel(path)');
    1313end
     14%check existence
    1415if ~exist(path)
    1516        error(['loadmodel error message: file ' path ' does not exist']);
    1617end
     18%check that the file is readable
     19[stat,mess]=fileattrib('larsenc8.model');
     20if( stat==0 | mess.UserRead~=1),
     21        error(['loadmodel error message: file ' path ' is not readable (permission dinied).']);
     22end
     23%check number of variables
    1724if length(whos('-file',path))>1,
    1825        error(['loadmodel error message: file ' path ' contains several variables. Only one model should be present.']);
Note: See TracChangeset for help on using the changeset viewer.