Our Products:   CompleteFTP  edtFTPnet/Free  edtFTPnet/PRO  edtFTPj/Free  edtFTPj/PRO
0 votes
3.7k views
in .NET FTP by (440 points)
ftpConnection.ChangeWorkingDirectory("/a/b/c");
ftpConnection.DownloadDirectory(localFilePath, "d/e");

I take it that the new working directory will now be /a/b/c/d/e

Is this intentional? Is there any way to avoid this other than placing another ftpConnection.ChangeWorkingDirectory("/a/b/c") statement after downloadirectory one? Thanks in advance.

Dominick Sidiropoulos, Softomotive Ltd.

3 Answers

0 votes
by (162k points)
Have you tried it? I think the cwd will be /a/b/c
0 votes
by (440 points)
SecureFTPConnection ftpConnection = new SecureFTPConnection();
ftpConnection.LicenseOwner = "<LicenseInfo>";
ftpConnection.LicenseKey = "<LicenseInfo>";

EnterpriseDT.Util.Debug.Logger.CurrentLevel = EnterpriseDT.Util.Debug.Level.ALL;
EnterpriseDT.Util.Debug.Logger.AddAppender(new EnterpriseDT.Util.Debug.FileAppender(Path.Combine(Directory.GetParent(System.Reflection.Assembly.GetExecutingAssembly().Location).ToString(), @"ftp.txt")));

ftpConnection.Protocol = FileTransferProtocol.SFTP;
ftpConnection.ServerAddress = "ime.groupcbf.com";
ftpConnection.ServerPort = 22;
ftpConnection.ConnectMode = FTPConnectMode.PASV;
ftpConnection.AuthenticationMethod = AuthenticationType.PublicKey;
ftpConnection.UserName = "ubuntu";
ftpConnection.Password = ftpConnection.ClientPrivateKeyPassphrase = @"";
ftpConnection.Timeout = 10000;
ftpConnection.ServerValidation = SecureFTPServerValidationType.None;
ftpConnection.ClientPrivateKeyFile = Path.Combine(Directory.GetParent(System.Reflection.Assembly.GetExecutingAssembly().Location).ToString(), @"PrivateKey.ppk");
// ftpConnection.TransferType = FTPTransferType.ASCII;

ftpConnection.Connect();

string workingDirectory = ftpConnection.WorkingDirectory;
ftpConnection.ChangeWorkingDirectory(@"/home/ubuntu/workspace/source_ime");
workingDirectory = ftpConnection.WorkingDirectory;
ftpConnection.DownloadDirectory(@"C:\groupcbf\ime\test", @"db/vendor/.svn");
workingDirectory = ftpConnection.WorkingDirectory;
ftpConnection.DownloadDirectory(@"C:\groupcbf\ime\test", @"db/vendor/plugins");

My debugger shows that the working directory before the second downloaddirectory statement has been changed to

/home/ubuntu/workspace/source_ime/db/vendor

Hence the second downloaddirectory statement fails unless I manually switch the working directory back to the original one (statement for this not included). Thanks in advance.

P.S.: If you need the generated logs just drop me an email and I will mail them over to you.
P.S.2: I am running this project using .Net2.0 in case this is of any significance
0 votes
by (162k points)
Please email us an All level log file (zipped).

Categories

...