anchor.diff:  implementation
   
   uses
  +  StrUtils,
     IdTCPClient, IdFTPCommon, IdReplyRFC, IdReplyFTP, IdExplicitTLSClientServerBase
     {$IFDEF LINUX},FileUtil, IdSSLOpenSSLHeaders{$ENDIF}
  +  ,mLog
     ;
  +
  +var
  +  logger : TmLog;
   
   { TFTPFoldersListFileSystem }
   
  
positive.code:   dirExists : boolean;
    tmpFolder : String;
  begin
    try
      aFTPClient.List(nil, aPath, false);
      dirExists := True;
      if aFTPClient.LastCmdResult.NumericCode = 450 then
      begin
        if Pos('no such', LowerCase(aFTPClient.LastCmdResult.Text.Text)) > 0 then //  has a message like 'No such file or directory' or similar)
          dirExists := false;
      end;
    except
      on e: EIdReplyRFCError do
      begin
        if (e.ErrorCode <> 550) or
          (Pos('not found', LowerCase(e.Message)) = 0) then
          //(e.Message does not have a message like 'Directory not found' or similar) then begin
          raise
        else
          dirExists := false;
      end;
    end;
  
    if not dirExists then
    begin
  
negative.code:   end;
  end;
  
  function TFTPFileSystemManager.ExistsFolder (aFTPClient : TIdFTP; const aPath: string) : boolean;
  begin
    Result := false;
  
    // this is ok for filezilla server:
    try
      aFTPClient.List(nil, aPath, false);
      if aFTPClient.LastCmdResult.NumericCode = 450 then
      begin
        if Pos('no such', LowerCase(aFTPClient.LastCmdResult.Text.Text)) > 0 then //  has a message like 'No such file or directory' or similar)
          exit;
      end;
    except
      on e: EIdReplyRFCError do
      begin
        {$IFDEF DEBUG}
        logger.Debug(IntToStr(e.ErrorCode) + ' ' + e.Message);
        {$ENDIF}
        if (e.ErrorCode <> 550) or (not AnsiContainsText(e.Message,'not found')) then
          //(e.Message does not have a message like 'Directory not found' or similar) then begin
          raise
      end;
    end;
  
    // this works for vftpd:
    try
      aFTPClient.ChangeDir(PATH_DELIMITER);
      aFTPClient.ChangeDir(aPath);
    except
      on e: EIdReplyRFCError do
      begin
        {$IFDEF DEBUG}
        logger.Debug(IntToStr(e.ErrorCode) + ' ' + e.Message);
        {$ENDIF}
        if (e.ErrorCode = 550) then
          exit
        else
          raise;
      end
      else
        raise;
    end;
    Result := true;
  end;
  
  // https://www.howtobuildsoftware.com/index.php/how-do/bqWO/delphi-indy10-delphi-xe7-idftp-direxists-and-makedir
  procedure TFTPFileSystemManager.InternalCreateSubFolders(aFTPClient : TIdFTP; const aPath: string);
  