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

Author Message
KLH

Guest


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

Code:
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.
KLH

Guest


I resolved part of the problem but I am still getting the same Recursive calls problem when I try to use the following:
Code:


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?
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24995
Location: Prague, Czechia
https://winscp.net/forum/viewtopic.php?t=23564
Advertisements

You can post new topics in this forum






Search Site

What is WinSCP?

It is award-winning SFTP client, SCP client, FTPS client and FTP client integrated into one software program for file transfer to FTP server or secure SFTP server. [More]

And it's free!

Donate

About donations

$9   $19   $49   $99

About donations

Recommend

WinSCP Privacy Policy

WinSCP License