diff --git a/mdl/m_datetime.pas b/mdl/m_datetime.pas index 99fecf0..a7706c3 100644 --- a/mdl/m_datetime.pas +++ b/mdl/m_datetime.pas @@ -20,6 +20,7 @@ Function CurDateDos : LongInt; Function CurDateJulian : LongInt; Function CurDateDT : DateTime; Function DateDos2Str (Date: LongInt; Format: Byte) : String; +Function DateDos2DT (Date: LongInt) : DateTime; Function DateJulian2Str (Date: LongInt; Format: Byte) : String; Function DateStr2Dos (Str: String) : LongInt; Function DateStr2Julian (Str: String) : LongInt; @@ -153,6 +154,11 @@ Begin GetTime (Result.Hour, Result.Min, Result.Sec, Temp); End; +Function DateDos2DT (Date: LongInt) : DateTime; +Begin + UnPackTime (Date, Result); +End; + Function TimerSeconds : LongInt; Var Hour, diff --git a/mdl/m_tcp_client.pas b/mdl/m_tcp_client.pas index eb71c37..f15cbfc 100644 --- a/mdl/m_tcp_client.pas +++ b/mdl/m_tcp_client.pas @@ -68,7 +68,7 @@ Begin If Client.FSocketHandle = -1 Then Exit; -// WriteLn ('DEBUG SEND ' + Str); + WriteLn ('DEBUG SENT ' + Str); Client.PurgeInputData(1); @@ -91,7 +91,7 @@ Begin ResponseType := strS2I(Copy(ResponseStr, 1, 3)); Result := ResponseType; -// WriteLn ('DEBUG RECV ' + ResponseStr); + WriteLn ('DEBUG RECV ' + ResponseStr); If ResponseStr[4] = '-' Then Begin {$IFDEF USESTRINGLIST} diff --git a/mdl/m_tcp_client_ftp.pas b/mdl/m_tcp_client_ftp.pas index 2034b69..ce4d095 100644 --- a/mdl/m_tcp_client_ftp.pas +++ b/mdl/m_tcp_client_ftp.pas @@ -12,6 +12,7 @@ Const ftpResOK = 0; ftpResFailed = 1; ftpResBadData = 2; + ftpResNoFile = 3; Type WordRec = Record @@ -174,9 +175,10 @@ Begin Client.WriteLine ('STOR ' + JustFile(FileName)); - OK := OpenDataSession; + OK := OpenDataSession; + Res := GetResponse; - If OK and (GetResponse = 150) Then Begin + If OK and (Res = 150) Then Begin Assign (F, FileName); If ioReset(F, 1, fmRWDN) Then Begin @@ -197,7 +199,10 @@ Begin If GetResponse = 226 Then Result := ftpResOK; End Else Begin - Result := ftpResBadData; + If Res = 550 Then + Result := ftpResNoFile + Else + Result := ftpResBadData; CloseDataSession; End; @@ -218,9 +223,10 @@ Begin Client.WriteLine('RETR ' + JustFile(FileName)); - OK := OpenDataSession; + OK := OpenDataSession; + Res := GetResponse; - If OK And (GetResponse = 150) Then Begin + If OK And (Res = 150) Then Begin Assign (F, FileName); If ioReWrite(F, 1, fmRWDW) Then Begin @@ -241,7 +247,10 @@ Begin If GetResponse = 226 Then Result := ftpResOK; End Else Begin - Result := ftpResBadData; + If Res = 550 Then + Result := ftpResNoFile + Else + Result := ftpResBadData; CloseDataSession; End;