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
   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
   i,j : longint;
@@ -1347,7 +1347,7 @@ begin
   move(path[1],buffer,length(path));
   buffer[length(path)]:=#0;
  { close first if opened }
-  if ((flags and $1000)=0) then
+  if ((flags and $10000)=0) then
    begin
      case filerec(f).mode of
       fminput,fmoutput,fminout : Do_Close(filerec(f).handle);
@@ -1374,7 +1374,7 @@ begin
   end;
   { READ/WRITE mode, create file in all cases }
   { REWRITE                                   }
-  if (flags and $100)<>0 then
+  if (flags and $1000)<>0 then
    begin
      filerec(f).mode:=fmoutput;
      oflags := 1006;
@@ -1382,7 +1382,7 @@ begin
   else
   { READ/WRITE mode on existing file }
   { APPEND                           }
-   if (flags and $10)<>0 then
+   if (flags and $100)<>0 then
     begin
       filerec(f).mode:=fmoutput;
       oflags := 1005;
@@ -1432,7 +1432,7 @@ begin
        Error2InOut;
 
     filerec(f).handle:=i;
-    if (flags and $10)<>0 then
+    if (flags and $100)<>0 then
        do_seekend(filerec(f).handle);
 
 end;
@@ -1814,7 +1814,10 @@ end.
 
 {
   $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
 
   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
   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
   i : word;
@@ -482,7 +482,7 @@ var
 begin
   AllowSlash(p);
  { close first if opened }
-  if ((flags and $1000)=0) then
+  if ((flags and $10000)=0) then
    begin
      case filerec(f).mode of
       fminput,fmoutput,fminout : Do_Close(filerec(f).handle);
@@ -506,13 +506,13 @@ begin
    1 : filerec(f).mode:=fmoutput;
    2 : filerec(f).mode:=fminout;
   end;
-  if (flags and $100)<>0 then
+  if (flags and $1000)<>0 then
    begin
      filerec(f).mode:=fmoutput;
      oflags:=$04;  { read/write with create }
    end
   else
-   if (flags and $10)<>0 then
+   if (flags and $100)<>0 then
     begin
       filerec(f).mode:=fmoutput;
       oflags:=$02;  { read/write             }
@@ -569,7 +569,7 @@ begin
   if errno <> 0 then
      Error2InOut;
   filerec(f).handle:=i;
-  if (flags and $10)<>0 then
+  if (flags and $100)<>0 then
    do_seekend(filerec(f).handle);
 end;
 
@@ -739,7 +739,10 @@ end.
 
 {
   $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
 
   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
   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 : longint;
 begin
   AllowSlash(p);
 { close first if opened }
-  if ((flags and $1000)=0) then
+  if ((flags and $10000)=0) then
    begin
      case filerec(f).mode of
       fminput,fmoutput,fminout : Do_Close(filerec(f).handle);
@@ -418,13 +418,13 @@ begin
    1 : filerec(f).mode:=fmoutput;
    2 : filerec(f).mode:=fminout;
   end;
-  if (flags and $100)<>0 then
+  if (flags and $1000)<>0 then
    begin
      filerec(f).mode:=fmoutput;
      oflags:=$8302;
    end
   else
-   if (flags and $10)<>0 then
+   if (flags and $100)<>0 then
     begin
       filerec(f).mode:=fmoutput;
       oflags:=$8404;
@@ -454,7 +454,7 @@ begin
         movl    f,%edx
         movw    %ax,(%edx)
   end;
-  if (flags and $10)<>0 then
+  if (flags and $100)<>0 then
    do_seekend(filerec(f).handle);
 end;
 
@@ -614,7 +614,10 @@ Begin
 End.
 {
   $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
     * 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
   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
   regs   : trealregs;
@@ -959,7 +959,7 @@ var
 begin
   AllowSlash(p);
 { close first if opened }
-  if ((flags and $1000)=0) then
+  if ((flags and $10000)=0) then
    begin
      case filerec(f).mode of
       fminput,fmoutput,fminout : Do_Close(filerec(f).handle);
@@ -980,7 +980,7 @@ begin
    1 : filerec(f).mode:=fmoutput;
    2 : filerec(f).mode:=fminout;
   end;
-  if (flags and $100)<>0 then
+  if (flags and $1000)<>0 then
    begin
      filerec(f).mode:=fmoutput;
      action:=$12; {create file function}
@@ -1034,7 +1034,7 @@ begin
     end;
 {$endif SYSTEMDEBUG}
 { append mode }
-  if (flags and $10)<>0 then
+  if (flags and $100)<>0 then
    begin
      do_seekend(filerec(f).handle);
      filerec(f).mode:=fmoutput; {fool fmappend}
@@ -1274,7 +1274,10 @@ Begin
 End.
 {
   $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
 
   Revision 1.15  1999/08/19 14:03:16  pierre

+ 5 - 2
rtl/inc/file.inc

@@ -69,7 +69,7 @@ Begin
    InOutRes:=2
   else
    Begin
-     Do_Open(f,PChar(@FileRec(f).Name),$101);
+     Do_Open(f,PChar(@FileRec(f).Name),$1001);
      FileRec(f).RecSize:=l;
    End;
 End;
@@ -415,7 +415,10 @@ End;
 
 {
   $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
 
   Revision 1.11  1999/09/07 15:54:18  hajny

+ 7 - 4
rtl/inc/text.inc

@@ -56,9 +56,9 @@ var
   Flags : Longint;
 Begin
   Case t.mode Of
-    fmInput : Flags:=$1000;
-   fmOutput : Flags:=$1101;
-   fmAppend : Flags:=$1011;
+    fmInput : Flags:=$10000;
+   fmOutput : Flags:=$11001;
+   fmAppend : Flags:=$10101;
   else
    begin
      InOutRes:=102;
@@ -952,7 +952,10 @@ end;
 
 {
   $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
 
   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
   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
 {$ifndef crtlib}
@@ -443,7 +443,7 @@ var
 {$endif}
 Begin
 { close first if opened }
-  if ((flags and $1000)=0) then
+  if ((flags and $10000)=0) then
    begin
      case FileRec(f).mode of
       fminput,fmoutput,fminout : Do_Close(FileRec(f).Handle);
@@ -472,10 +472,10 @@ Begin
          FileRec(f).mode:=fminout;
        end;
   end;
-  if (flags and $100)=$100 then
+  if (flags and $1000)=$1000 then
    oflags:=oflags or (Open_CREAT or Open_TRUNC)
   else
-   if (flags and $10)=$10 then
+   if (flags and $100)=$100 then
     oflags:=oflags or (Open_APPEND);
 { empty name is special }
   if p[0]=#0 then
@@ -504,7 +504,6 @@ Begin
      Oflags:=Oflags and not(Open_RDWR);
      FileRec(f).Handle:=sys_open(p,oflags,438);
    end;
-
   Errno2Inoutres;
 {$endif}
 End;
@@ -676,10 +675,12 @@ end;
 {*****************************************************************************
                          System Dependent Exit code
 *****************************************************************************}
+
 Procedure system_exit;
 begin
 end;
 
+
 {*****************************************************************************
                          SystemUnit Initialization
 *****************************************************************************}
@@ -724,7 +725,10 @@ End.
 
 {
   $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
 
   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
   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;
@@ -449,7 +449,7 @@ var oflags:byte;
 begin
     allowslash(p);
     { close first if opened }
-    if ((flags and $1000)=0) then
+    if ((flags and $10000)=0) then
         begin
             case filerec(f).mode of
                 fminput,fmoutput,fminout : Do_Close(filerec(f).handle);
@@ -473,13 +473,13 @@ begin
         1 : filerec(f).mode:=fmoutput;
         2 : filerec(f).mode:=fminout;
     end;
-    if (flags and $100)<>0 then
+    if (flags and $1000)<>0 then
         begin
             filerec(f).mode:=fmoutput;
             oflags:=2;
         end
     else
-        if (flags and $10)<>0 then
+        if (flags and $100)<>0 then
             begin
                 filerec(f).mode:=fmoutput;
                 oflags:=2;
@@ -496,7 +496,7 @@ begin
             end;
             exit;
         end;
-    if (flags and $100)<>0 then
+    if (flags and $1000)<>0 then
         {Use create function.}
         asm
             movb $0x3c,%ah
@@ -524,7 +524,7 @@ begin
             movl f,%edx
             movw %ax,(%edx)
         end;
-    if (flags and $10)<>0 then
+    if (flags and $100)<>0 then
         do_seekend(filerec(f).handle);
 end;
 
@@ -750,7 +750,10 @@ begin
 end.
 {
   $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
     * 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
   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
   file_Share_Read  = $00000001;
@@ -453,7 +453,7 @@ Var
 begin
   AllowSlash(p);
 { close first if opened }
-  if ((flags and $1000)=0) then
+  if ((flags and $10000)=0) then
    begin
      case filerec(f).mode of
        fminput,fmoutput,fminout : Do_Close(filerec(f).handle);
@@ -499,11 +499,11 @@ begin
 { standard is opening and existing file }
   cd:=OPEN_EXISTING;
 { create it ? }
-  if (flags and $100)<>0 then
+  if (flags and $1000)<>0 then
    cd:=CREATE_ALWAYS
 { or append ? }
   else
-   if (flags and $10)<>0 then
+   if (flags and $100)<>0 then
     cd:=OPEN_ALWAYS;
 { empty name is special }
   if p[0]=#0 then
@@ -520,7 +520,7 @@ begin
    end;
   filerec(f).handle:=CreateFile(p,oflags,shflags,nil,cd,FILE_ATTRIBUTE_NORMAL,0);
 { append mode }
-  if (flags and $10)<>0 then
+  if (flags and $100)<>0 then
    begin
      do_seekend(filerec(f).handle);
      filerec(f).mode:=fmoutput; {fool fmappend}
@@ -677,7 +677,7 @@ begin
   count:=0;
   cmdline:=getcommandfile;
   Arglen:=0;
-  while (cmdline[Arglen]<>#0) do 
+  while (cmdline[Arglen]<>#0) do
     Inc(ArgLen);
   getmem(argsbuf[count],arglen);
   move(cmdline^,argsbuf[count]^,arglen);
@@ -1009,7 +1009,10 @@ end.
 
 {
   $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
 
   Revision 1.42  1999/07/07 09:43:16  michael