--- rtl/inc/typefile-orig.inc	2026-03-05 19:12:35
+++ rtl/inc/typefile.inc	2026-03-05 22:11:46
@@ -106,7 +106,10 @@
   FileRec(f)._private[1]:=0;
 
   Reset(UnTypedFile(f),Size);
-  BlockRead(UntypedFile(f),(pbyte(@f)+sizeof(FileRec))^,1);
+  if not(eof(f)) then
+    BlockRead(UntypedFile(f),(pbyte(@f)+sizeof(FileRec))^,1)
+  else
+    FileRec(f)._private[1]:=1;
 End;
