This project is read-only.

SetWorkingDirectory with dot

Jun 25, 2013 at 10:20 AM
Edited Jun 25, 2013 at 10:24 AM
Hello Author,

I am sorry if my English is not perfect, but I'm French.

I use your FTP client and it works great ! But I have a problem when I want to use a working directory with dot, like that :
So, if I use this code :

            For Each item In ftp.GetListing(ftp.GetWorkingDirectory())
                Select Case item.Type
                    Case FtpFileSystemObjectType.Directory
                        Console.WriteLine("Folder:" + item.FullName)
                    Case FtpFileSystemObjectType.File
                        Console.WriteLine("File:" + item.FullName)
                End Select
It does not work. I don't have result in output. But if I just put /folder1/folder2 in ftp.SetWorkingDirectory, I have results.

So, how can I do ?


Jun 25, 2013 at 2:37 PM
Please post a transaction log per the instructions Examples\Debug.cs as well as the results. It's hard to say anything just looking at your code.
Jun 26, 2013 at 9:46 AM
Hello jptrosclair,

Thank you for the answer.

I have a problem with :
 FtpTrace.AddListener(New TextWriterTraceListener("log_file.txt"))
The code :
Imports System.Net.FtpClient
Imports System.Diagnostics
Imports System

Public NotInheritable Class ConnectFTP
    Public Shared Sub connect()
        FtpTrace.AddListener(New TextWriterTraceListener("log_file.txt"))
        Using ftp = New FtpClient()
        End Using
    End Sub
End Class
The IDE say : "FtpTrace is not declare, It may be inaccessible due to its protection level."

Can you help me ?

Thanks !
Jun 26, 2013 at 1:53 PM
Edited Jun 26, 2013 at 1:53 PM
drop FtpTrace.AddListener and use:
Imports System.Diagnostics
Debug.Listeners.Add(new TextWriterTraceListener("log_file.txt"))
You also need to be linking against the debug build, not the release.
Jun 26, 2013 at 2:39 PM
Thank for the information !
230 User   logged in.
500 'FEAT': command not understood.
CWD /folder1/folder2
250 CWD command successful.
257 "/folder1/folder2" is current directory.
200 Type set to I.
229 Entering Extended Passive Mode (|||35424|)

... (Sorry, I can't show some folders' name)

Failed to parse file listing: total 42
Failed to parse file listing: drwxr-xr-x   7  user1 user1       512 Sep 27  2011 .
Failed to parse file listing: drwxr-xr-x  31 user1  user1      1024 Sep 27  2011 ..
Failed to parse file listing: lrwxrwxrwx   1 user1  user1      9 Sep 27  2011 data.0000 -> data.6460
Failed to parse file listing: drwxr-xr-x  10 user1  user1      512 Jun 29  2012 data.6460
Failed to parse file listing: lrwxrwxrwx   1 user1 user1       8 Sep 27  2011 sys.0000 -> sys.6460
Failed to parse file listing: drwxr-xr-x 133 user1  user1     4096 Jun 25 16:26 sys.6460
All folders with dot in the name can't be listing ...
Jun 26, 2013 at 2:54 PM
I can't reproduce this problem at all. I just ran the sample listing below through the LIST parser and it parses fine. Please get the latest revision and try it out. Also, have a look at the file listing section on the documentation page. It contains some
useful information in regards to the reliability of the parsers and what the best option is.
Jun 26, 2013 at 2:54 PM
Also, where did you get the library from? Are you running the latest download from this site or are you using the latest nugget package?
Jun 26, 2013 at 3:08 PM
I use the latest library (System.Net.FtpClient, download from codeplex ...
Jun 28, 2013 at 8:46 PM
Edited Jun 28, 2013 at 8:46 PM
I uploaded a new release today, it includes an updated UNIX list parser that might be of interest to you. Just FYI, symlinks (some of the failures above) are not supported by the parser (never have been).