[fpc-pascal] TIOStream and .Position

2009-12-05 Thread Žilvinas Ledas
Hello all, is this intended behavior or it is a bug that iostream.Position always returns -1? In iostream unit I see that there is <...> TIOStream = class(THandleStream) private FType : longint; FPos : Int64; <...> but if I use code like: <...> var iostream: TIOStream; begin iostre

Re: [fpc-pascal] TIOStream and .Position

2009-12-05 Thread Jonas Maebe
On 05 Dec 2009, at 21:42, Žilvinas Ledas wrote: > is this intended behavior or it is a bug that iostream.Position always > returns -1? Are you reading from standard input or so? In that case it's logical that the position is always -1, since you can't seek standard input (in theory it's infin

Re: [fpc-pascal] TIOStream and .Position

2009-12-05 Thread Žilvinas Ledas
Yes, I am. But I thought that it is not that logical after I found function: --- FPos: Int64; --- and --- function TIOStream.Seek(Offset: Longint; Origin: Word): Longint; <...> { Try to fake seek by reading and discarding } <...> --- Either way, I have modified mine iostream code to return curre