Put this in the wrong forum I think - Recursive calls not allowed

Advertisement

KLH
Guest

Put this in the wrong forum I think - Recursive calls not allowed

I have established that directories exist. I go through the rfi.names list to removed them but always get the Recursive calls not allowed.

public RemovalOperationResult RemoveFiles(string path) 
    { 
        using (Session session = new Session()) 
        { 
          session.Open(Config.FtpSessionOptions); 
          return session.RemoveFiles(session.EscapeFileMask(path)); 
        } 
    } 
---------------------------------------------------- 
 RemoteDirectoryInfo rdi = ftpsSession.ListDirectory(ftpPath); 
 foreach (RemoteFileInfo rfi in rdi.Files) 
 { 
    if (rfi.IsDirectory) 
      { 

         RemovalOperationResult ror; 
         ror = ftpsSession.RemoveFiles(ftpPath + rfi.Name); 
         if (ror.IsSuccess) 
         { 
         foreach (RemovalEventArgs removal in ror.Removals){ 
            log.Event("Removal of " + removal.FileName + " succeeded"); 
         } 
     } 
     else 
     { 
         log.Event("Removal failed."); 
         return false; 
     }

It doesn't seem to matter what the path is.
It does seem to be resolving to the right point. Everything else I am doing besides removal is working happily. I am very confused.

Reply with quote

Advertisement

KLH
Guest

Got a but furthuer

I resolved part of the problem but I am still getting the same Recursive calls problem when I try to use the following:
public RemovalOperationResult RemoveFiles(string path)
{
    using (Session session = new Session())
    {
        session.Open(Config.FtpSessionOptions);
        return session.RemoveFiles(session.EscapeFileMask(path));
    }
}
Pretty much every call I attempt to make to session.RemoveFiles is resulting in a Recursive Calls are not allowed response in the Results.

I have tried "xxxx.txt", "\xxx\xxx.txt", "*" "\" no paths seem to work. I checked the permissions on the account I use to create the session and they are fine. I can manipulate everything properly with an FTP client. Just not with the WINSCPnet API. Anyone have any ideas?

Reply with quote

Advertisement

You can post new topics in this forum