============= 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. _______________________________________________ Lazarus mailing list Lazarus@lazarus.freepascal.org http://www.lazarus.freepascal.org/mailman/listinfo/lazarus