[Lazarus] TFileStream

Dave Coventry dgcoventry at gmail.com
Thu Jan 29 09:54:39 CET 2009


============= snip ===================
   case ftype of
     43://'+'
     begin
       FS:=TFileStream.Create(fname, fmshareDenyWrite);
       Try
         FS.Seek(pos,soFromBeginning);
         FS.ReadBuffer(fldheader[0],4);
         increm:=LEtoN(PLongInt(fldheader)^)+1;
         for m:=0 to 3 do
         begin
           fldheader[m]:=increm and 255;
           increm:=increm shr 8;
         end;
          FS.Seek(pos,soFromBeginning);
          FS.WriteBuffer(fldheader[0],4); <----- Fails here
       Finally
         FreeAndNil(FS);
       end;
     end;
   end;
============= snip ===================

Continuing on the same block:

I am trying to read a block of 4 bytes, increment it by one and write
it back again.

However, if fails on the write.



More information about the Lazarus mailing list