I am working with TFileStream in Delphi 2006. When I invoke TFileStream.Seek with an offset that is out of bounds I am getting different return values. When I seek to a position below the beginning of the stream, the function returns -1 and if I seek to a beyond the stream size, the function returns what would have been the position in the stream if the stream was that large. Is there a way to check whether a seek operation on the stream was successful? Why does TFileStream.Seek not fail when the seek offsets are out of bounds of the current stream size?
Thanks in advance.