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. ============================================================= > I'm having some difficulty over this: > > ============= snip =================== > FS:=TFileStream.Create(fname, fmshareDenyWrite); > Try > FS.ReadBuffer(hdbuffer[0],32); > Finally > FreeAndNil(FS); > end; > RecSize:=LEtoN(PSmallInt(@hdbuffer[10])^); > SetLength(recbuffer,RecSize); > FillChar(recbuffer,RecSize,' '); > pos:=68; > bufferpos:=1; > setLength(fldheader,48); > for i:=0 to gFields.Count-1 do > begin > ftype:=getFieldType(PChar(gFields.GetItem(i))); > case ftype of > 43://'+' > begin > FS:=TFileStream.Create(fname, fmshareDenyWrite);<----- Fails here > Try > FS.Seek(pos,soFromBeginning); > FS.ReadBuffer(fldheader[0],4); > Finally > FreeAndNil(FS); > end; > end; > ============= snip =================== > > Project raised exception class 'External: SIGSEgV' > > Followed by: > > Project raised exception class 'RunError (216)' > 'Access Violation' > > What am I doing wrong? > _______________________________________________ > Lazarus mailing list > Lazarus@lazarus.freepascal.org > http://www.lazarus.freepascal.org/mailman/listinfo/lazarus > > > _______________________________________________ Lazarus mailing list Lazarus@lazarus.freepascal.org http://www.lazarus.freepascal.org/mailman/listinfo/lazarus