[Lazarus] TFileStream

Dave Coventry dgcoventry at gmail.com
Mon Jan 26 15:40:17 CET 2009


Hi AJ.

I was under the impression that this:

 FS:=TFileStream.Create(fname, fmshareDenyWrite);
 Try
   FS.ReadBuffer(hdbuffer[0],32);
 Finally
   FreeAndNil(FS);<-----
 end;

would free the File Pointer to be used again.

Do you suggest that I use another variable when I do it the second time?

Is it possible to specify that the program only uses one thread?

I'm having a lot of unexplained errors in developing this app and I'm
wondering if this isn't the cause of a lot of them.


FS2:=TFileStream.Create(fname, fmshareDenyWrite);

Surely that would fail too?

2009/1/26 ajv <ajv at vogelaar-electronics.com>:
> Dear Dave Coventry,
>
> Probably the FileStream still exist in an other thread.
> Application.ProcessMessages might help.
> Better is it to open the stream on fname once an reposition the pointer
> repeatedly.
>
> Success.



More information about the Lazarus mailing list