FIX: Bug [0000455] Copying a directory to FTP and it already exists displays "Unknown error" message

This commit is contained in:
Alexander Koblov 2015-08-14 19:03:06 +00:00
commit afe3e29b0f

View file

@ -807,10 +807,18 @@ function FsMkDir(RemoteDir: PAnsiChar): BOOL; dcpcall;
var
sPath: AnsiString;
FtpSend: TFTPSendEx;
sOldPath: AnsiString;
begin
Result := False;
if GetConnectionByPath(RemoteDir, FtpSend, sPath) then
Result := FtpSend.CreateDir(sPath);
begin
sOldPath := FtpSend.GetCurrentDir;
if FtpSend.ChangeWorkingDir(sPath) then
Result := FtpSend.ChangeWorkingDir(sOldPath)
else begin
Result := FtpSend.CreateDir(sPath);
end;
end;
end;
function FsRemoveDir(RemoteName: PAnsiChar): BOOL; dcpcall;