Post a reply

Options
Add an Attachment

If you do not want to add an Attachment to your Post, please leave the Fields blank.

(maximum 10 MB; please compress large files; only common media, archive, text and programming file formats are allowed)

Options

Topic review

KLH

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?
KLH

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.