ftpsend - support for large streams
git-svn-id: https://svn.code.sf.net/p/synalist/code/trunk@146 7c85be65-684b-0410-a082-b2ed4fbef004
This commit is contained in:
parent
d6c8fd080b
commit
f5be030c70
34
ftpsend.pas
34
ftpsend.pas
@ -1,5 +1,5 @@
|
||||
{==============================================================================|
|
||||
| Project : Ararat Synapse | 003.005.004 |
|
||||
| Project : Ararat Synapse | 004.000.000 |
|
||||
|==============================================================================|
|
||||
| Content: FTP client |
|
||||
|==============================================================================|
|
||||
@ -92,7 +92,7 @@ type
|
||||
FFileName: String;
|
||||
FDirectory: Boolean;
|
||||
FReadable: Boolean;
|
||||
FFileSize: Longint;
|
||||
FFileSize: int64;
|
||||
FFileTime: TDateTime;
|
||||
FOriginalLine: string;
|
||||
FMask: string;
|
||||
@ -107,7 +107,7 @@ type
|
||||
{:if you have rights to read}
|
||||
property Readable: Boolean read FReadable write FReadable;
|
||||
{:size of file in bytes}
|
||||
property FileSize: Longint read FFileSize write FFileSize;
|
||||
property FileSize: int64 read FFileSize write FFileSize;
|
||||
{:date and time of file. Local server timezone is used. Any timezone
|
||||
conversions was not done!}
|
||||
property FileTime: TDateTime read FFileTime write FFileTime;
|
||||
@ -228,7 +228,7 @@ type
|
||||
FFullSSL: Boolean;
|
||||
function Auth(Mode: integer): Boolean; virtual;
|
||||
function Connect: Boolean; virtual;
|
||||
function InternalStor(const Command: string; RestoreAt: integer): Boolean; virtual;
|
||||
function InternalStor(const Command: string; RestoreAt: int64): Boolean; virtual;
|
||||
function DataSocket: Boolean; virtual;
|
||||
function AcceptDataSocket: Boolean; virtual;
|
||||
procedure DoStatus(Response: Boolean; const Value: string); virtual;
|
||||
@ -308,7 +308,7 @@ type
|
||||
|
||||
{:Return size of Filename file on FTP server. If command failed (i.e. not
|
||||
implemented), return -1.}
|
||||
function FileSize(const FileName: string): integer; virtual;
|
||||
function FileSize(const FileName: string): int64; virtual;
|
||||
|
||||
{:Send NOOP command to FTP server for preserve of disconnect by inactivity
|
||||
timeout.}
|
||||
@ -1040,10 +1040,10 @@ begin
|
||||
end;
|
||||
end;
|
||||
|
||||
function TFTPSend.InternalStor(const Command: string; RestoreAt: integer): Boolean;
|
||||
function TFTPSend.InternalStor(const Command: string; RestoreAt: int64): Boolean;
|
||||
var
|
||||
SendStream: TStream;
|
||||
StorSize: integer;
|
||||
StorSize: int64;
|
||||
begin
|
||||
Result := False;
|
||||
if FDirectFile then
|
||||
@ -1087,7 +1087,7 @@ end;
|
||||
|
||||
function TFTPSend.StoreFile(const FileName: string; Restore: Boolean): Boolean;
|
||||
var
|
||||
RestoreAt: integer;
|
||||
RestoreAt: int64;
|
||||
begin
|
||||
Result := False;
|
||||
if FileName = '' then
|
||||
@ -1113,7 +1113,7 @@ begin
|
||||
Result := False;
|
||||
if FileName = '' then
|
||||
Exit;
|
||||
Result := InternalStor('APPE '+FileName, 0);
|
||||
Result := InternalStor('APPE ' + FileName, 0);
|
||||
end;
|
||||
|
||||
function TFTPSend.NoOp: Boolean;
|
||||
@ -1134,7 +1134,7 @@ begin
|
||||
Result := (FTPCommand('DELE ' + FileName) div 100) = 2;
|
||||
end;
|
||||
|
||||
function TFTPSend.FileSize(const FileName: string): integer;
|
||||
function TFTPSend.FileSize(const FileName: string): int64;
|
||||
var
|
||||
s: string;
|
||||
begin
|
||||
@ -1143,7 +1143,11 @@ begin
|
||||
begin
|
||||
s := Trim(SeparateRight(ResultString, ' '));
|
||||
s := Trim(SeparateLeft(s, ' '));
|
||||
Result := StrToIntDef(s, -1);
|
||||
{$IFDEF VER100}
|
||||
Result := StrToIntDef(s, -1);
|
||||
{$ELSE}
|
||||
Result := StrToInt64Def(s, -1);
|
||||
{$ENDIF}
|
||||
end;
|
||||
end;
|
||||
|
||||
@ -1676,7 +1680,11 @@ begin
|
||||
x := StrToIntDef(BlockSize, 1)
|
||||
else
|
||||
x := 1;
|
||||
{$IFDEF VER100}
|
||||
Value.FileSize := x * StrToIntDef(Size, 0);
|
||||
{$ELSE}
|
||||
Value.FileSize := x * StrToInt64Def(Size, 0);
|
||||
{$ENDIF}
|
||||
|
||||
DecodeDate(Date,myear,mmonth,mday);
|
||||
mhours := 0;
|
||||
@ -1767,7 +1775,11 @@ begin
|
||||
'r':
|
||||
flr.Readable := true;
|
||||
's':
|
||||
{$IFDEF VER100}
|
||||
flr.FileSize := StrToIntDef(Copy(s, 2, Length(s) - 1), 0);
|
||||
{$ELSE}
|
||||
flr.FileSize := StrToInt64Def(Copy(s, 2, Length(s) - 1), 0);
|
||||
{$ENDIF}
|
||||
'm':
|
||||
flr.FileTime := (StrToIntDef(Copy(s, 2, Length(s) - 1), 0) / 86400)
|
||||
+ 25569;
|
||||
|
Loading…
x
Reference in New Issue
Block a user