I tried to resolve the 2GB file size limit of Indy9 but failed

Giganews Newsgroups
Subject: I tried to resolve the 2GB file size limit of Indy9 but failed
Posted by:  Star Hiker (star_hik…@hotmail.com)
Date: Thu, 28 Apr 2005

At first I want to resolve the problem of Size():
//------------------------My modified code:
function TIdFTP.Size(const AFileName: String): Int64; //Integer;
var
  SizeStr: String;
begin
  result := -1;
  if SendCmd('SIZE ' + AFileName) = 213 then begin  {Do not translate}
    SizeStr := Trim(LastCmdResult.Text.Text);
    system.delete(SizeStr, 1, IndyPos(' ', SizeStr)); // delete the response
{Do not translate}
    result := StrToInt64Def(SizeStr,-1); //StrToIntDef(SizeStr, -1);
  end;
end;
//------------------------

Then I recompiled my program,and try to download a file which size is over
2GB,but above function still returned -1,where is it wrong?
I'm a C++ coder,not familiar with pascal.
I'm using Indy 9 for BCB6.

Replies