From 081a4104d91988ef4093bdad7c721f2ff0cb6ff8 Mon Sep 17 00:00:00 2001 From: Michael Stumpf Date: Mon, 3 Dec 2018 15:37:16 +0100 Subject: [PATCH] bugfix: fileBeg not set if create mode --- matlab/@ucf/ucf.m | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/matlab/@ucf/ucf.m b/matlab/@ucf/ucf.m index 1958113..14a8451 100644 --- a/matlab/@ucf/ucf.m +++ b/matlab/@ucf/ucf.m @@ -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;