----- Original Message ----- 
From: "Angus Robertson - Magenta Systems Ltd" <[EMAIL PROTECTED]>
To: <twsocket@elists.org>
Sent: Wednesday, September 07, 2005 12:53 AM
Subject: Re: [twsocket] 64-bit FTP support


>> 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;
>
One uses a Word for the origin, one uses a TSeekOrigin.  If you pass 
soFromBeginning, its a word so it uses the Longint version.  If however you 
pass soBeginning, it is a TSeekOrigin so it uses the Int64 version. At least 
in my experience.  I think it should be better documented.

Dan 

-- 
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