istream=fopen("dummy.txt","rt");

disp ("### First 4 lines of file ###");
for n = 1:4
    fgetl(istream)
endfor

disp ("### Current file position ###");
fpos=ftell(istream)

disp ("### Line 5 ###");
first__pass = fgetl(istream)

disp ("### Count lines in file ###");
linecount=5
while (ischar(fgetl(istream)))
  ++linecount
endwhile

disp ("### Status of fseek call ###");
status = fseek (istream,52)

disp ("### File position after fseek call ###");
fpos=ftell(istream)

disp ("### Line 5 second time ###");
second_pass = fgetl(istream)

disp ("### Line 6 (should be) ###");
fgetl(istream)

fclose(istream);
