Browse Source

* fixed do_open flags to be > $100, becuase filemode can be upto 255

peter 26 years ago
parent
commit
3b5373c08a

+ 11 - 8
rtl/amiga/sysamiga.pas

@@ -1305,9 +1305,9 @@ procedure do_open(var f;p:pchar;flags:longint);
 {
 {
   filerec and textrec have both handle and mode as the first items so
   filerec and textrec have both handle and mode as the first items so
   they could use the same routine for opening/creating.
   they could use the same routine for opening/creating.
-  when (flags and $10)   the file will be append
-  when (flags and $100)  the file will be truncate/rewritten
-  when (flags and $1000) there is no check for close (needed for textfiles)
+  when (flags and $100)   the file will be append
+  when (flags and $1000)  the file will be truncate/rewritten
+  when (flags and $10000) there is no check for close (needed for textfiles)
 }
 }
 var
 var
   i,j : longint;
   i,j : longint;
@@ -1347,7 +1347,7 @@ begin
   move(path[1],buffer,length(path));
   move(path[1],buffer,length(path));
   buffer[length(path)]:=#0;
   buffer[length(path)]:=#0;
  { close first if opened }
  { close first if opened }
-  if ((flags and $1000)=0) then
+  if ((flags and $10000)=0) then
    begin
    begin
      case filerec(f).mode of
      case filerec(f).mode of
       fminput,fmoutput,fminout : Do_Close(filerec(f).handle);
       fminput,fmoutput,fminout : Do_Close(filerec(f).handle);
@@ -1374,7 +1374,7 @@ begin
   end;
   end;
   { READ/WRITE mode, create file in all cases }
   { READ/WRITE mode, create file in all cases }
   { REWRITE                                   }
   { REWRITE                                   }
-  if (flags and $100)<>0 then
+  if (flags and $1000)<>0 then
    begin
    begin
      filerec(f).mode:=fmoutput;
      filerec(f).mode:=fmoutput;
      oflags := 1006;
      oflags := 1006;
@@ -1382,7 +1382,7 @@ begin
   else
   else
   { READ/WRITE mode on existing file }
   { READ/WRITE mode on existing file }
   { APPEND                           }
   { APPEND                           }
-   if (flags and $10)<>0 then
+   if (flags and $100)<>0 then
     begin
     begin
       filerec(f).mode:=fmoutput;
       filerec(f).mode:=fmoutput;
       oflags := 1005;
       oflags := 1005;
@@ -1432,7 +1432,7 @@ begin
        Error2InOut;
        Error2InOut;
 
 
     filerec(f).handle:=i;
     filerec(f).handle:=i;
-    if (flags and $10)<>0 then
+    if (flags and $100)<>0 then
        do_seekend(filerec(f).handle);
        do_seekend(filerec(f).handle);
 
 
 end;
 end;
@@ -1814,7 +1814,10 @@ end.
 
 
 {
 {
   $Log$
   $Log$
-  Revision 1.12  1999-01-18 10:05:47  pierre
+  Revision 1.13  1999-09-10 15:40:32  peter
+    * fixed do_open flags to be > $100, becuase filemode can be upto 255
+
+  Revision 1.12  1999/01/18 10:05:47  pierre
    + system_exit procedure added
    + system_exit procedure added
 
 
   Revision 1.11  1998/12/28 15:50:42  peter
   Revision 1.11  1998/12/28 15:50:42  peter

+ 11 - 8
rtl/atari/sysatari.pas

@@ -472,9 +472,9 @@ procedure do_open(var f;p:pchar;flags:longint);
 {
 {
   filerec and textrec have both handle and mode as the first items so
   filerec and textrec have both handle and mode as the first items so
   they could use the same routine for opening/creating.
   they could use the same routine for opening/creating.
-  when (flags and $10)   the file will be append
-  when (flags and $100)  the file will be truncate/rewritten
-  when (flags and $1000) there is no check for close (needed for textfiles)
+  when (flags and $100)   the file will be append
+  when (flags and $1000)  the file will be truncate/rewritten
+  when (flags and $10000) there is no check for close (needed for textfiles)
 }
 }
 var
 var
   i : word;
   i : word;
@@ -482,7 +482,7 @@ var
 begin
 begin
   AllowSlash(p);
   AllowSlash(p);
  { close first if opened }
  { close first if opened }
-  if ((flags and $1000)=0) then
+  if ((flags and $10000)=0) then
    begin
    begin
      case filerec(f).mode of
      case filerec(f).mode of
       fminput,fmoutput,fminout : Do_Close(filerec(f).handle);
       fminput,fmoutput,fminout : Do_Close(filerec(f).handle);
@@ -506,13 +506,13 @@ begin
    1 : filerec(f).mode:=fmoutput;
    1 : filerec(f).mode:=fmoutput;
    2 : filerec(f).mode:=fminout;
    2 : filerec(f).mode:=fminout;
   end;
   end;
-  if (flags and $100)<>0 then
+  if (flags and $1000)<>0 then
    begin
    begin
      filerec(f).mode:=fmoutput;
      filerec(f).mode:=fmoutput;
      oflags:=$04;  { read/write with create }
      oflags:=$04;  { read/write with create }
    end
    end
   else
   else
-   if (flags and $10)<>0 then
+   if (flags and $100)<>0 then
     begin
     begin
       filerec(f).mode:=fmoutput;
       filerec(f).mode:=fmoutput;
       oflags:=$02;  { read/write             }
       oflags:=$02;  { read/write             }
@@ -569,7 +569,7 @@ begin
   if errno <> 0 then
   if errno <> 0 then
      Error2InOut;
      Error2InOut;
   filerec(f).handle:=i;
   filerec(f).handle:=i;
-  if (flags and $10)<>0 then
+  if (flags and $100)<>0 then
    do_seekend(filerec(f).handle);
    do_seekend(filerec(f).handle);
 end;
 end;
 
 
@@ -739,7 +739,10 @@ end.
 
 
 {
 {
   $Log$
   $Log$
-  Revision 1.11  1999-01-18 10:05:48  pierre
+  Revision 1.12  1999-09-10 15:40:33  peter
+    * fixed do_open flags to be > $100, becuase filemode can be upto 255
+
+  Revision 1.11  1999/01/18 10:05:48  pierre
    + system_exit procedure added
    + system_exit procedure added
 
 
   Revision 1.10  1998/12/28 15:50:43  peter
   Revision 1.10  1998/12/28 15:50:43  peter

+ 11 - 8
rtl/go32v1/system.pp

@@ -385,16 +385,16 @@ procedure do_open(var f;p:pchar;flags:longint);
 {
 {
   filerec and textrec have both handle and mode as the first items so
   filerec and textrec have both handle and mode as the first items so
   they could use the same routine for opening/creating.
   they could use the same routine for opening/creating.
-  when (flags and $10)   the file will be append
-  when (flags and $100)  the file will be truncate/rewritten
-  when (flags and $1000) there is no check for close (needed for textfiles)
+  when (flags and $100)   the file will be append
+  when (flags and $1000)  the file will be truncate/rewritten
+  when (flags and $10000) there is no check for close (needed for textfiles)
 }
 }
 var
 var
   oflags : longint;
   oflags : longint;
 begin
 begin
   AllowSlash(p);
   AllowSlash(p);
 { close first if opened }
 { close first if opened }
-  if ((flags and $1000)=0) then
+  if ((flags and $10000)=0) then
    begin
    begin
      case filerec(f).mode of
      case filerec(f).mode of
       fminput,fmoutput,fminout : Do_Close(filerec(f).handle);
       fminput,fmoutput,fminout : Do_Close(filerec(f).handle);
@@ -418,13 +418,13 @@ begin
    1 : filerec(f).mode:=fmoutput;
    1 : filerec(f).mode:=fmoutput;
    2 : filerec(f).mode:=fminout;
    2 : filerec(f).mode:=fminout;
   end;
   end;
-  if (flags and $100)<>0 then
+  if (flags and $1000)<>0 then
    begin
    begin
      filerec(f).mode:=fmoutput;
      filerec(f).mode:=fmoutput;
      oflags:=$8302;
      oflags:=$8302;
    end
    end
   else
   else
-   if (flags and $10)<>0 then
+   if (flags and $100)<>0 then
     begin
     begin
       filerec(f).mode:=fmoutput;
       filerec(f).mode:=fmoutput;
       oflags:=$8404;
       oflags:=$8404;
@@ -454,7 +454,7 @@ begin
         movl    f,%edx
         movl    f,%edx
         movw    %ax,(%edx)
         movw    %ax,(%edx)
   end;
   end;
-  if (flags and $10)<>0 then
+  if (flags and $100)<>0 then
    do_seekend(filerec(f).handle);
    do_seekend(filerec(f).handle);
 end;
 end;
 
 
@@ -614,7 +614,10 @@ Begin
 End.
 End.
 {
 {
   $Log$
   $Log$
-  Revision 1.5  1999-06-01 13:23:11  peter
+  Revision 1.6  1999-09-10 15:40:33  peter
+    * fixed do_open flags to be > $100, becuase filemode can be upto 255
+
+  Revision 1.5  1999/06/01 13:23:11  peter
     * fixes to work with the new makefile
     * fixes to work with the new makefile
     * os2 compiles now correct under linux
     * os2 compiles now correct under linux
 
 

+ 10 - 7
rtl/go32v2/system.pp

@@ -949,9 +949,9 @@ procedure do_open(var f;p:pchar;flags:longint);
 {
 {
   filerec and textrec have both handle and mode as the first items so
   filerec and textrec have both handle and mode as the first items so
   they could use the same routine for opening/creating.
   they could use the same routine for opening/creating.
-  when (flags and $10)   the file will be append
-  when (flags and $100)  the file will be truncate/rewritten
-  when (flags and $1000) there is no check for close (needed for textfiles)
+  when (flags and $100)   the file will be append
+  when (flags and $1000)  the file will be truncate/rewritten
+  when (flags and $10000) there is no check for close (needed for textfiles)
 }
 }
 var
 var
   regs   : trealregs;
   regs   : trealregs;
@@ -959,7 +959,7 @@ var
 begin
 begin
   AllowSlash(p);
   AllowSlash(p);
 { close first if opened }
 { close first if opened }
-  if ((flags and $1000)=0) then
+  if ((flags and $10000)=0) then
    begin
    begin
      case filerec(f).mode of
      case filerec(f).mode of
       fminput,fmoutput,fminout : Do_Close(filerec(f).handle);
       fminput,fmoutput,fminout : Do_Close(filerec(f).handle);
@@ -980,7 +980,7 @@ begin
    1 : filerec(f).mode:=fmoutput;
    1 : filerec(f).mode:=fmoutput;
    2 : filerec(f).mode:=fminout;
    2 : filerec(f).mode:=fminout;
   end;
   end;
-  if (flags and $100)<>0 then
+  if (flags and $1000)<>0 then
    begin
    begin
      filerec(f).mode:=fmoutput;
      filerec(f).mode:=fmoutput;
      action:=$12; {create file function}
      action:=$12; {create file function}
@@ -1034,7 +1034,7 @@ begin
     end;
     end;
 {$endif SYSTEMDEBUG}
 {$endif SYSTEMDEBUG}
 { append mode }
 { append mode }
-  if (flags and $10)<>0 then
+  if (flags and $100)<>0 then
    begin
    begin
      do_seekend(filerec(f).handle);
      do_seekend(filerec(f).handle);
      filerec(f).mode:=fmoutput; {fool fmappend}
      filerec(f).mode:=fmoutput; {fool fmappend}
@@ -1274,7 +1274,10 @@ Begin
 End.
 End.
 {
 {
   $Log$
   $Log$
-  Revision 1.16  1999-09-08 16:09:18  peter
+  Revision 1.17  1999-09-10 15:40:33  peter
+    * fixed do_open flags to be > $100, becuase filemode can be upto 255
+
+  Revision 1.16  1999/09/08 16:09:18  peter
     * do_isdevice not called if already error
     * do_isdevice not called if already error
 
 
   Revision 1.15  1999/08/19 14:03:16  pierre
   Revision 1.15  1999/08/19 14:03:16  pierre

+ 5 - 2
rtl/inc/file.inc

@@ -69,7 +69,7 @@ Begin
    InOutRes:=2
    InOutRes:=2
   else
   else
    Begin
    Begin
-     Do_Open(f,PChar(@FileRec(f).Name),$101);
+     Do_Open(f,PChar(@FileRec(f).Name),$1001);
      FileRec(f).RecSize:=l;
      FileRec(f).RecSize:=l;
    End;
    End;
 End;
 End;
@@ -415,7 +415,10 @@ End;
 
 
 {
 {
   $Log$
   $Log$
-  Revision 1.12  1999-09-08 16:12:24  peter
+  Revision 1.13  1999-09-10 15:40:33  peter
+    * fixed do_open flags to be > $100, becuase filemode can be upto 255
+
+  Revision 1.12  1999/09/08 16:12:24  peter
     * fixed inoutres for diskfull
     * fixed inoutres for diskfull
 
 
   Revision 1.11  1999/09/07 15:54:18  hajny
   Revision 1.11  1999/09/07 15:54:18  hajny

+ 7 - 4
rtl/inc/text.inc

@@ -56,9 +56,9 @@ var
   Flags : Longint;
   Flags : Longint;
 Begin
 Begin
   Case t.mode Of
   Case t.mode Of
-    fmInput : Flags:=$1000;
-   fmOutput : Flags:=$1101;
-   fmAppend : Flags:=$1011;
+    fmInput : Flags:=$10000;
+   fmOutput : Flags:=$11001;
+   fmAppend : Flags:=$10101;
   else
   else
    begin
    begin
      InOutRes:=102;
      InOutRes:=102;
@@ -952,7 +952,10 @@ end;
 
 
 {
 {
   $Log$
   $Log$
-  Revision 1.55  1999-09-08 16:12:24  peter
+  Revision 1.56  1999-09-10 15:40:33  peter
+    * fixed do_open flags to be > $100, becuase filemode can be upto 255
+
+  Revision 1.55  1999/09/08 16:12:24  peter
     * fixed inoutres for diskfull
     * fixed inoutres for diskfull
 
 
   Revision 1.54  1999/09/07 07:44:58  peter
   Revision 1.54  1999/09/07 07:44:58  peter

+ 12 - 8
rtl/linux/syslinux.pp

@@ -433,9 +433,9 @@ Procedure Do_Open(var f;p:pchar;flags:longint);
 {
 {
   FileRec and textrec have both Handle and mode as the first items so
   FileRec and textrec have both Handle and mode as the first items so
   they could use the same routine for opening/creating.
   they could use the same routine for opening/creating.
-  when (flags and $10)   the file will be append
-  when (flags and $100)  the file will be truncate/rewritten
-  when (flags and $1000) there is no check for close (needed for textfiles)
+  when (flags and $100)   the file will be append
+  when (flags and $1000)  the file will be truncate/rewritten
+  when (flags and $10000) there is no check for close (needed for textfiles)
 }
 }
 var
 var
 {$ifndef crtlib}
 {$ifndef crtlib}
@@ -443,7 +443,7 @@ var
 {$endif}
 {$endif}
 Begin
 Begin
 { close first if opened }
 { close first if opened }
-  if ((flags and $1000)=0) then
+  if ((flags and $10000)=0) then
    begin
    begin
      case FileRec(f).mode of
      case FileRec(f).mode of
       fminput,fmoutput,fminout : Do_Close(FileRec(f).Handle);
       fminput,fmoutput,fminout : Do_Close(FileRec(f).Handle);
@@ -472,10 +472,10 @@ Begin
          FileRec(f).mode:=fminout;
          FileRec(f).mode:=fminout;
        end;
        end;
   end;
   end;
-  if (flags and $100)=$100 then
+  if (flags and $1000)=$1000 then
    oflags:=oflags or (Open_CREAT or Open_TRUNC)
    oflags:=oflags or (Open_CREAT or Open_TRUNC)
   else
   else
-   if (flags and $10)=$10 then
+   if (flags and $100)=$100 then
     oflags:=oflags or (Open_APPEND);
     oflags:=oflags or (Open_APPEND);
 { empty name is special }
 { empty name is special }
   if p[0]=#0 then
   if p[0]=#0 then
@@ -504,7 +504,6 @@ Begin
      Oflags:=Oflags and not(Open_RDWR);
      Oflags:=Oflags and not(Open_RDWR);
      FileRec(f).Handle:=sys_open(p,oflags,438);
      FileRec(f).Handle:=sys_open(p,oflags,438);
    end;
    end;
-
   Errno2Inoutres;
   Errno2Inoutres;
 {$endif}
 {$endif}
 End;
 End;
@@ -676,10 +675,12 @@ end;
 {*****************************************************************************
 {*****************************************************************************
                          System Dependent Exit code
                          System Dependent Exit code
 *****************************************************************************}
 *****************************************************************************}
+
 Procedure system_exit;
 Procedure system_exit;
 begin
 begin
 end;
 end;
 
 
+
 {*****************************************************************************
 {*****************************************************************************
                          SystemUnit Initialization
                          SystemUnit Initialization
 *****************************************************************************}
 *****************************************************************************}
@@ -724,7 +725,10 @@ End.
 
 
 {
 {
   $Log$
   $Log$
-  Revision 1.26  1999-09-08 16:14:43  peter
+  Revision 1.27  1999-09-10 15:40:35  peter
+    * fixed do_open flags to be > $100, becuase filemode can be upto 255
+
+  Revision 1.26  1999/09/08 16:14:43  peter
     * pointer fixes
     * pointer fixes
 
 
   Revision 1.25  1999/07/28 23:18:36  peter
   Revision 1.25  1999/07/28 23:18:36  peter

+ 12 - 9
rtl/os2/sysos2.pas

@@ -439,9 +439,9 @@ procedure do_open(var f;p:pchar;flags:longint);
 {
 {
   filerec and textrec have both handle and mode as the first items so
   filerec and textrec have both handle and mode as the first items so
   they could use the same routine for opening/creating.
   they could use the same routine for opening/creating.
-  when (flags and $10)   the file will be append
-  when (flags and $100)  the file will be truncate/rewritten
-  when (flags and $1000) there is no check for close (needed for textfiles)
+  when (flags and $100)   the file will be append
+  when (flags and $1000)  the file will be truncate/rewritten
+  when (flags and $10000) there is no check for close (needed for textfiles)
 }
 }
 
 
 var oflags:byte;
 var oflags:byte;
@@ -449,7 +449,7 @@ var oflags:byte;
 begin
 begin
     allowslash(p);
     allowslash(p);
     { close first if opened }
     { close first if opened }
-    if ((flags and $1000)=0) then
+    if ((flags and $10000)=0) then
         begin
         begin
             case filerec(f).mode of
             case filerec(f).mode of
                 fminput,fmoutput,fminout : Do_Close(filerec(f).handle);
                 fminput,fmoutput,fminout : Do_Close(filerec(f).handle);
@@ -473,13 +473,13 @@ begin
         1 : filerec(f).mode:=fmoutput;
         1 : filerec(f).mode:=fmoutput;
         2 : filerec(f).mode:=fminout;
         2 : filerec(f).mode:=fminout;
     end;
     end;
-    if (flags and $100)<>0 then
+    if (flags and $1000)<>0 then
         begin
         begin
             filerec(f).mode:=fmoutput;
             filerec(f).mode:=fmoutput;
             oflags:=2;
             oflags:=2;
         end
         end
     else
     else
-        if (flags and $10)<>0 then
+        if (flags and $100)<>0 then
             begin
             begin
                 filerec(f).mode:=fmoutput;
                 filerec(f).mode:=fmoutput;
                 oflags:=2;
                 oflags:=2;
@@ -496,7 +496,7 @@ begin
             end;
             end;
             exit;
             exit;
         end;
         end;
-    if (flags and $100)<>0 then
+    if (flags and $1000)<>0 then
         {Use create function.}
         {Use create function.}
         asm
         asm
             movb $0x3c,%ah
             movb $0x3c,%ah
@@ -524,7 +524,7 @@ begin
             movl f,%edx
             movl f,%edx
             movw %ax,(%edx)
             movw %ax,(%edx)
         end;
         end;
-    if (flags and $10)<>0 then
+    if (flags and $100)<>0 then
         do_seekend(filerec(f).handle);
         do_seekend(filerec(f).handle);
 end;
 end;
 
 
@@ -750,7 +750,10 @@ begin
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.16  1999-06-01 13:23:16  peter
+  Revision 1.17  1999-09-10 15:40:35  peter
+    * fixed do_open flags to be > $100, becuase filemode can be upto 255
+
+  Revision 1.16  1999/06/01 13:23:16  peter
     * fixes to work with the new makefile
     * fixes to work with the new makefile
     * os2 compiles now correct under linux
     * os2 compiles now correct under linux
 
 

+ 12 - 9
rtl/win32/syswin32.pp

@@ -435,9 +435,9 @@ procedure do_open(var f;p : pchar;flags:longint);
 {
 {
   filerec and textrec have both handle and mode as the first items so
   filerec and textrec have both handle and mode as the first items so
   they could use the same routine for opening/creating.
   they could use the same routine for opening/creating.
-  when (flags and $10)   the file will be append
-  when (flags and $100)  the file will be truncate/rewritten
-  when (flags and $1000) there is no check for close (needed for textfiles)
+  when (flags and $100)   the file will be append
+  when (flags and $1000)  the file will be truncate/rewritten
+  when (flags and $10000) there is no check for close (needed for textfiles)
 }
 }
 Const
 Const
   file_Share_Read  = $00000001;
   file_Share_Read  = $00000001;
@@ -453,7 +453,7 @@ Var
 begin
 begin
   AllowSlash(p);
   AllowSlash(p);
 { close first if opened }
 { close first if opened }
-  if ((flags and $1000)=0) then
+  if ((flags and $10000)=0) then
    begin
    begin
      case filerec(f).mode of
      case filerec(f).mode of
        fminput,fmoutput,fminout : Do_Close(filerec(f).handle);
        fminput,fmoutput,fminout : Do_Close(filerec(f).handle);
@@ -499,11 +499,11 @@ begin
 { standard is opening and existing file }
 { standard is opening and existing file }
   cd:=OPEN_EXISTING;
   cd:=OPEN_EXISTING;
 { create it ? }
 { create it ? }
-  if (flags and $100)<>0 then
+  if (flags and $1000)<>0 then
    cd:=CREATE_ALWAYS
    cd:=CREATE_ALWAYS
 { or append ? }
 { or append ? }
   else
   else
-   if (flags and $10)<>0 then
+   if (flags and $100)<>0 then
     cd:=OPEN_ALWAYS;
     cd:=OPEN_ALWAYS;
 { empty name is special }
 { empty name is special }
   if p[0]=#0 then
   if p[0]=#0 then
@@ -520,7 +520,7 @@ begin
    end;
    end;
   filerec(f).handle:=CreateFile(p,oflags,shflags,nil,cd,FILE_ATTRIBUTE_NORMAL,0);
   filerec(f).handle:=CreateFile(p,oflags,shflags,nil,cd,FILE_ATTRIBUTE_NORMAL,0);
 { append mode }
 { append mode }
-  if (flags and $10)<>0 then
+  if (flags and $100)<>0 then
    begin
    begin
      do_seekend(filerec(f).handle);
      do_seekend(filerec(f).handle);
      filerec(f).mode:=fmoutput; {fool fmappend}
      filerec(f).mode:=fmoutput; {fool fmappend}
@@ -677,7 +677,7 @@ begin
   count:=0;
   count:=0;
   cmdline:=getcommandfile;
   cmdline:=getcommandfile;
   Arglen:=0;
   Arglen:=0;
-  while (cmdline[Arglen]<>#0) do 
+  while (cmdline[Arglen]<>#0) do
     Inc(ArgLen);
     Inc(ArgLen);
   getmem(argsbuf[count],arglen);
   getmem(argsbuf[count],arglen);
   move(cmdline^,argsbuf[count]^,arglen);
   move(cmdline^,argsbuf[count]^,arglen);
@@ -1009,7 +1009,10 @@ end.
 
 
 {
 {
   $Log$
   $Log$
-  Revision 1.43  1999-07-07 10:04:43  michael
+  Revision 1.44  1999-09-10 15:40:35  peter
+    * fixed do_open flags to be > $100, becuase filemode can be upto 255
+
+  Revision 1.43  1999/07/07 10:04:43  michael
   + Small edit in paramstr
   + Small edit in paramstr
 
 
   Revision 1.42  1999/07/07 09:43:16  michael
   Revision 1.42  1999/07/07 09:43:16  michael