## -*- octave -*-
 [id, msg] = tmpfile ();
 if (id < 0)
   __printf_assert__ ("tmpfile failed: %s\n", msg);
 else
   unwind_protect
     fwrite (id, "abcd");
     frewind (id);
     [data, count] = fread (id, [2, 3], "char");
     assert (data, [97, 99; 98, 100]);
     assert (count, 4);
   unwind_protect_cleanup
     fclose (id);
   end_unwind_protect
 endif
   
