Stuff
This commit is contained in:
parent
1bc9872f99
commit
76b42f6852
|
@ -35,7 +35,6 @@ Function FileCopy (Source, Target: String) : Boolean;
|
||||||
Function FileFind (FN: String) : String;
|
Function FileFind (FN: String) : String;
|
||||||
Function FileByteSize (FN: String) : Int64;
|
Function FileByteSize (FN: String) : Int64;
|
||||||
Function FileNewExt (FN, NewExt: String) : String;
|
Function FileNewExt (FN, NewExt: String) : String;
|
||||||
Procedure FileAppend (F1, F2: String);
|
|
||||||
|
|
||||||
{ GLOBAL FILEIO VARIABLES AND CONSTANTS }
|
{ GLOBAL FILEIO VARIABLES AND CONSTANTS }
|
||||||
|
|
||||||
|
@ -562,39 +561,6 @@ Begin
|
||||||
Result := FN + '.' + NewExt;
|
Result := FN + '.' + NewExt;
|
||||||
End;
|
End;
|
||||||
|
|
||||||
Procedure FileAppend (F1, F2: String);
|
|
||||||
Var
|
|
||||||
BufIn,
|
|
||||||
BufOut : Array[1..8*1024] of Char;
|
|
||||||
TF1 : Text;
|
|
||||||
TF2 : Text;
|
|
||||||
Str : String;
|
|
||||||
Begin
|
|
||||||
Assign (TF1, F1);
|
|
||||||
|
|
||||||
{$I-} Reset(TF1); {$I+}
|
|
||||||
|
|
||||||
If IoResult <> 0 Then Exit;
|
|
||||||
|
|
||||||
SetTextBuf (TF1, BufIn);
|
|
||||||
|
|
||||||
Assign (TF2, F2);
|
|
||||||
{$I-} Append(TF2); {$I+}
|
|
||||||
|
|
||||||
If (IoResult = 2) Then
|
|
||||||
ReWrite (TF2);
|
|
||||||
|
|
||||||
SetTextBuf (TF2, BufOut);
|
|
||||||
|
|
||||||
While Not Eof(TF1) Do Begin
|
|
||||||
ReadLn (TF1, Str);
|
|
||||||
WriteLn (TF2, Str);
|
|
||||||
End;
|
|
||||||
|
|
||||||
Close (TF1);
|
|
||||||
Close (TF2);
|
|
||||||
End;
|
|
||||||
|
|
||||||
{ FILE STREAMING FUNCTIONS }
|
{ FILE STREAMING FUNCTIONS }
|
||||||
|
|
||||||
Constructor TFileBuffer.Create (BufferSize: LongInt);
|
Constructor TFileBuffer.Create (BufferSize: LongInt);
|
||||||
|
|
|
@ -54,6 +54,8 @@ Begin
|
||||||
|
|
||||||
If Client.FSocketHandle = -1 Then Exit;
|
If Client.FSocketHandle = -1 Then Exit;
|
||||||
|
|
||||||
|
WriteLn ('DEBUG SEND ' + Str);
|
||||||
|
|
||||||
Client.PurgeInputData(1);
|
Client.PurgeInputData(1);
|
||||||
|
|
||||||
Client.WriteLine(Str);
|
Client.WriteLine(Str);
|
||||||
|
@ -89,6 +91,8 @@ Begin
|
||||||
Until Copy(Str, 1, 4) = strI2S(ResponseType) + ' ';
|
Until Copy(Str, 1, 4) = strI2S(ResponseType) + ' ';
|
||||||
End;
|
End;
|
||||||
End;
|
End;
|
||||||
|
|
||||||
|
writeln('DEBUG RECV ' + ResponseStr);
|
||||||
End;
|
End;
|
||||||
|
|
||||||
End.
|
End.
|
||||||
|
|
|
@ -75,16 +75,12 @@ Begin
|
||||||
|
|
||||||
WaitSock.WaitInit(NetInterface, DataPort);
|
WaitSock.WaitInit(NetInterface, DataPort);
|
||||||
|
|
||||||
DataSocket := NIL;
|
|
||||||
DataSocket := WaitSock.WaitConnection(10000);
|
DataSocket := WaitSock.WaitConnection(10000);
|
||||||
|
|
||||||
If Not Assigned(DataSocket) Then Begin
|
|
||||||
WaitSock.Free;
|
|
||||||
|
|
||||||
Exit;
|
|
||||||
End;
|
|
||||||
|
|
||||||
WaitSock.Free;
|
WaitSock.Free;
|
||||||
|
|
||||||
|
If Not Assigned(DataSocket) Then
|
||||||
|
Exit;
|
||||||
End;
|
End;
|
||||||
|
|
||||||
Result := True;
|
Result := True;
|
||||||
|
@ -164,6 +160,8 @@ Begin
|
||||||
|
|
||||||
If Not FileExist(FileName) Then Exit;
|
If Not FileExist(FileName) Then Exit;
|
||||||
|
|
||||||
|
WriteLn ('DEBUG SendFile Passive ', Passive, ' Filename ', FileName);
|
||||||
|
|
||||||
SetPassive(Passive);
|
SetPassive(Passive);
|
||||||
|
|
||||||
Client.WriteLine ('STOR ' + JustFile(FileName));
|
Client.WriteLine ('STOR ' + JustFile(FileName));
|
||||||
|
|
Loading…
Reference in New Issue