Always return "\" as login folder

Apr 13, 2012 at 7:53 PM
I test the code to connect to different FTP server under Linux and Windows, and find it always return "\" as login directoy. In Linux, mostly, the login folder should be at /home/username. After call Login(), connect to the ftp server, at time, if get FtpClient's CurrentDirectory, it always return "\". I check the Login() implement in FileClient.cs. Since it call this.CurrentDirectory = new FtpDirectory(this, "/") at the end. That makes _currentDirectory is "\", since it is not null, when get the CurrentDirectory, it just return "\" instead of sending "PWD" command to get the indeed directory.
Apr 13, 2012 at 8:01 PM

Check out revision d04dfa541513 which should solve the problem. It doesn't set the working directory in the login method which means unless you call SetWorkingDirectory(), it will query the server for the current working directory.

Apr 13, 2012 at 11:08 PM
Thanks, it works now. Since I need to go through different directories on the ftp server, so get the correct starting point is very important.
Apr 14, 2012 at 5:23 AM

No problem