bugfix: fileBeg not set if create mode

This commit is contained in:
Michael Stumpf 2018-12-03 15:37:16 +01:00
parent 4bd60a6929
commit 081a4104d9
1 changed files with 8 additions and 1 deletions

View File

@ -170,6 +170,11 @@ classdef ucf < handle
if obj.fileID<0
error('Unable to open file: %s',obj.File);
end
obj.fileBeg = ftell(obj.fileID);
fseek(obj.fileID,0,'eof');
obj.fileEnd = ftell(obj.fileID);
fseek(obj.fileID,0,'bof');
obj.FileSize = obj.fileEnd-obj.fileBeg;
% Read the file header
obj.readHeaderFile()
% Scan through file to get the basic structure (steps/sets)
@ -228,7 +233,9 @@ classdef ucf < handle
if obj.fileID<0
error('Unable to create file: %s',obj.File);
end
%
obj.fileBeg = ftell(obj.fileID);
obj.fileEnd = ftell(obj.fileID);
obj.FileSize = obj.fileEnd-obj.fileBeg;
switch par.Results.type
case 'field'
obj.typeID = obj.typeIDmatlabField;