back_to_front; front_to_back
drag and drop from keyboard inside read.
this is just a record


%------------------------------------------------------------
fclose all
fid = fopen(file, 'r', 'ieee-be');  % the OS processor writes little-endian
fout = fopen('back_to_front.test','w')

%from back to  front 
fseek(fid, 0, 'eof');
len_file = ftell(fid);
nbytes = config.nbytes + 2;
last_index = floor(len_file / nbytes) - 1;
buf = []


for ii = last_index:-1:1
   buf = [];
   fseek(fid, nbytes * (ii - 1), 'bof'); %use ilist
   buf = read_buf(fid, params, config);
   if (ischar(buf))
      fprintf(fout,'ii = %d, %s\n',ii,buf);
   elseif(isstruct(buf))
      fprintf(fout, 'structure found at ii = %d\n',ii);
   else
      fprintf(fout,'NOT structure or char at ii = %d\n',ii);
   end
      if (isempty(buf))
      fprintf(fout, '... empty at ii=%d\n',ii);
   end
end


%------------------------------------------------------------
fclose all
fid = fopen(file, 'r', 'ieee-be');  % the OS processor writes little-endian
fout = fopen('front_to_back.test','w')


buf = [];
%from front to back
fseek(fid, 0, 'bof');
last_index = 7000;  %big enough


for ii = 1: last_index
   fseek(fid, nbytes * (ii - 1), 'bof'); %use ilist
   buf = read_buf(fid, params, config);
   if (ischar(buf))
      fprintf(fout,'ii = %d, %s\n',ii,buf);
   elseif(isstruct(buf))
      fprintf(fout, 'structure found at ii = %d\n',ii);
   else
      fprintf(fout,'NOT structure or char at ii = %d\n',ii);
   end
      if (isempty(buf))
      fprintf(fout, '... empty at ii=%d\n',ii);
   end
end
   