[Lazarus] TFileStream

Andrew Brunner andrew.t.brunner at gmail.com
Wed Jan 7 03:39:27 CET 2009


You could c write specific calls to write a byte or segment of contiguous bytes.

FS.Seek(128,soFromBegining);
FS.WriteBuffer(fsBuffer[128],1);

FS.Seek(132,soFromBegining);
FS.WriteBuffer(fsBuffer[132],1);



On Tue, Jan 6, 2009 at 7:55 PM, Dave Coventry <dgcoventry at gmail.com> wrote:
> I've started using TFileStream since posting a query here, but I'd
> like to know a bit more about it.
>
> Is there somewhere that I can find information on how to use it?
>
> Specifically, if I load a file into an array as follows:
>
> FS:=TFileStream.Create(fname, fmshareDenyWrite);
> FS.ReadBuffer(fsbuffer,recsize);
>
> can I alter the array and then save the altered array back into the file?
>
> do I just write the entire array back?
>
> fsbuffer[128]:=56;
> fsbuffer[132]:=42;
> FS.WriteBuffer(fsbuffer,recsize);
>
>
> or is there a better way?
> _______________________________________________
> Lazarus mailing list
> Lazarus at lazarus.freepascal.org
> http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
>



More information about the Lazarus mailing list