Browse Source

* support fm_inout as stdoutput for assign(f,'');rewrite(f,1); becuase
rewrite opens always with filemode 2

peter 25 years ago
parent
commit
48603ff7a3
5 changed files with 79 additions and 38 deletions
  1. 16 8
      rtl/go32v1/system.pp
  2. 16 8
      rtl/go32v2/system.pp
  3. 15 7
      rtl/linux/syslinux.pp
  4. 16 7
      rtl/os2/sysos2.pas
  5. 16 8
      rtl/win32/syswin32.pp

+ 16 - 8
rtl/go32v1/system.pp

@@ -432,13 +432,17 @@ begin
 { empty name is special }
   if p[0]=#0 then
    begin
-     case filerec(f).mode of
-       fminput : filerec(f).handle:=StdInputHandle;
-      fmappend,
-      fmoutput : begin
-                   filerec(f).handle:=StdOutputHandle;
-                   filerec(f).mode:=fmoutput; {fool fmappend}
-                 end;
+     case FileRec(f).mode of
+       fminput :
+         FileRec(f).Handle:=StdInputHandle;
+       fminout, { this is set by rewrite }
+       fmoutput :
+         FileRec(f).Handle:=StdOutputHandle;
+       fmappend :
+         begin
+           FileRec(f).Handle:=StdOutputHandle;
+           FileRec(f).mode:=fmoutput; {fool fmappend}
+         end;
      end;
      exit;
    end;
@@ -614,7 +618,11 @@ Begin
 End.
 {
   $Log$
-  Revision 1.8  2000-01-07 16:41:30  daniel
+  Revision 1.9  2000-01-20 23:38:02  peter
+    * support fm_inout as stdoutput for assign(f,'');rewrite(f,1); becuase
+      rewrite opens always with filemode 2
+
+  Revision 1.8  2000/01/07 16:41:30  daniel
     * copyright 2000
 
   Revision 1.7  2000/01/07 16:32:23  daniel

+ 16 - 8
rtl/go32v2/system.pp

@@ -1022,13 +1022,17 @@ begin
 { empty name is special }
   if p[0]=#0 then
    begin
-     case filerec(f).mode of
-       fminput : filerec(f).handle:=StdInputHandle;
-      fmappend,
-      fmoutput : begin
-                   filerec(f).handle:=StdOutputHandle;
-                   filerec(f).mode:=fmoutput; {fool fmappend}
-                 end;
+     case FileRec(f).mode of
+       fminput :
+         FileRec(f).Handle:=StdInputHandle;
+       fminout, { this is set by rewrite }
+       fmoutput :
+         FileRec(f).Handle:=StdOutputHandle;
+       fmappend :
+         begin
+           FileRec(f).Handle:=StdOutputHandle;
+           FileRec(f).mode:=fmoutput; {fool fmappend}
+         end;
      end;
      exit;
    end;
@@ -1339,7 +1343,11 @@ Begin
 End.
 {
   $Log$
-  Revision 1.29  2000-01-16 22:25:38  peter
+  Revision 1.30  2000-01-20 23:38:02  peter
+    * support fm_inout as stdoutput for assign(f,'');rewrite(f,1); becuase
+      rewrite opens always with filemode 2
+
+  Revision 1.29  2000/01/16 22:25:38  peter
     * check handle for file closing
 
   Revision 1.28  2000/01/07 16:41:32  daniel

+ 15 - 7
rtl/linux/syslinux.pp

@@ -438,12 +438,16 @@ Begin
   if p[0]=#0 then
    begin
      case FileRec(f).mode of
-       fminput : FileRec(f).Handle:=StdInputHandle;
-      fmoutput,
-      fmappend : begin
-                   FileRec(f).Handle:=StdOutputHandle;
-                   FileRec(f).mode:=fmoutput; {fool fmappend}
-                 end;
+       fminput :
+         FileRec(f).Handle:=StdInputHandle;
+       fminout, { this is set by rewrite }
+       fmoutput :
+         FileRec(f).Handle:=StdOutputHandle;
+       fmappend :
+         begin
+           FileRec(f).Handle:=StdOutputHandle;
+           FileRec(f).mode:=fmoutput; {fool fmappend}
+         end;
      end;
      exit;
    end;
@@ -741,7 +745,11 @@ End.
 
 {
   $Log$
-  Revision 1.33  2000-01-16 22:25:38  peter
+  Revision 1.34  2000-01-20 23:38:02  peter
+    * support fm_inout as stdoutput for assign(f,'');rewrite(f,1); becuase
+      rewrite opens always with filemode 2
+
+  Revision 1.33  2000/01/16 22:25:38  peter
     * check handle for file closing
 
   Revision 1.32  2000/01/07 16:41:41  daniel

+ 16 - 7
rtl/os2/sysos2.pas

@@ -492,12 +492,17 @@ begin
     { empty name is special }
     if p[0]=#0 then
         begin
-            case filerec(f).mode of
-                fminput:filerec(f).handle:=StdInputHandle;
-                fmappend,fmoutput : begin
-                    filerec(f).handle:=StdOutputHandle;
-                    filerec(f).mode:=fmoutput; {fool fmappend}
-                end;
+          case FileRec(f).mode of
+            fminput :
+              FileRec(f).Handle:=StdInputHandle;
+            fminout, { this is set by rewrite }
+            fmoutput :
+              FileRec(f).Handle:=StdOutputHandle;
+            fmappend :
+              begin
+                FileRec(f).Handle:=StdOutputHandle;
+                FileRec(f).mode:=fmoutput; {fool fmappend}
+              end;
             end;
             exit;
         end;
@@ -755,7 +760,11 @@ begin
 end.
 {
   $Log$
-  Revision 1.23  2000-01-16 23:10:15  peter
+  Revision 1.24  2000-01-20 23:38:02  peter
+    * support fm_inout as stdoutput for assign(f,'');rewrite(f,1); becuase
+      rewrite opens always with filemode 2
+
+  Revision 1.23  2000/01/16 23:10:15  peter
     * handle check fixed
 
   Revision 1.22  2000/01/16 22:25:38  peter

+ 16 - 8
rtl/win32/syswin32.pp

@@ -527,13 +527,17 @@ begin
 { empty name is special }
   if p[0]=#0 then
    begin
-     case filerec(f).mode of
-       fminput : filerec(f).handle:=StdInputHandle;
-      fmappend,
-      fmoutput : begin
-                   filerec(f).handle:=StdOutputHandle;
-                   filerec(f).mode:=fmoutput; {fool fmappend}
-                 end;
+     case FileRec(f).mode of
+       fminput :
+         FileRec(f).Handle:=StdInputHandle;
+       fminout, { this is set by rewrite }
+       fmoutput :
+         FileRec(f).Handle:=StdOutputHandle;
+       fmappend :
+         begin
+           FileRec(f).Handle:=StdOutputHandle;
+           FileRec(f).mode:=fmoutput; {fool fmappend}
+         end;
      end;
      exit;
    end;
@@ -1166,7 +1170,11 @@ end.
 
 {
   $Log$
-  Revision 1.57  2000-01-18 09:03:04  pierre
+  Revision 1.58  2000-01-20 23:38:02  peter
+    * support fm_inout as stdoutput for assign(f,'');rewrite(f,1); becuase
+      rewrite opens always with filemode 2
+
+  Revision 1.57  2000/01/18 09:03:04  pierre
     * DLL crash fixed : ExitProcess can not be called in DLL system_exit
       Problem : Halt or RunError code inside DLL will return to caller !!
     * Changed the "if h<4 then" into "if do_isdevice(h) then " in do_close