[fpc-devel] Read from memory stream with position before start of file

C Western l at c-m-w.me.uk
Thu Mar 12 22:29:13 CET 2009


Paul Ishenin wrote:
> Michael Van Canneyt wrote:
>> And writing ?
>>   
> Silently do nothing:
>
> procedure TForm4.Button1Click(Sender: TObject);
> var
>  S: TMemoryStream;
>  B: Byte;
>  Count: Integer;
> begin
>  S := TMemoryStream.Create;
>  S.Position := -1;
>  B := 1;
>  S.Write(B, SizeOf(B));
>  ShowMessage(IntToStr(S.Size));
>  S.Free;
> end;
>
> it shows 0
>
> Best regards,
> Paul Ishenin.
I have submitted a patch:

<http://bugs.freepascal.org/view.php?id=13318>

Colin



More information about the fpc-devel mailing list