> Are you sure you were using soBeginning, soEnd etc. instead of 
> soFromBeginning, soFromEnd.
> I had this problem when I started using int64 streams and that was the 
> solution.

These have the same numeric values so should not make any difference to 
how the stream is used.  

soFromBeginning = 0; soFromCurrent = 1; soFromEnd = 2;
TSeekOrigin = (soBeginning, soCurrent, soEnd);

My problem was that although code insight suggests the Int64 version 
was being called, there was a range error as soon as the offset 
exceeded a longint, so the compiler must have been used the longint 
version. 

function Seek(Offset: Longint; Origin: Word): Longint; overload; virtual;
function Seek(const Offset: Int64; Origin: TSeekOrigin): Int64; override;

All I did was wrote my own seek64 calling the real FileSeek API 
directly, and suddenly both FTP client and server started behaving 
themselves.  It's possible the compiler was confused because the stream 
is defined as TStream rather than TFileStream, and the former does not 
have a 64-bit seek.  I'm still using Delphi 6, so this might have been 
fixed in D7, although a quick look at the D7 library source did not 
suggest any changes. 

Angus

-- 
To unsubscribe or change your settings for TWSocket mailing list
please goto http://www.elists.org/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be

Reply via email to