DirFormat Auto doesn't work properly - WeOnlyDo Discussion board

DirFormat Auto doesn't work properly (General questions)

by Mike Guta, Wednesday, April 14, 2010, 13:24 (5336 days ago)

Hi,

I upgraded one of our old systems to the latest version of WOD FtpDLX.Net today and DirFormats.Auto stopped working properly with one of our SFTP servers. I managed to find a work-around though, which seems to work if I force the MVS format, but I think you should update your parsing methods to ensure the Auto mode can work properly.

My workaround:
- I initialized the FtpClient.DirFormat on Auto
- After I open the connection, I do a ListDir() on the home folder
- If the ListItem property looks like my servers's pattern, I change the DirFormat to MVS. I'm using the following Regex to identify it:

internal static Regex DirFormat_MVS_Pattern =
new Regex(
((?isxm-)^[\-d][\-rwx]{9}(\s+\d+){4}\s+[a-z]{3}\s+\d+\s+[:\d]+\s+[^\r\n]+) ,
RegexOptions.IgnoreCase
| RegexOptions.ExplicitCapture
| RegexOptions.CultureInvariant
| RegexOptions.IgnorePatternWhitespace
| RegexOptions.Compiled
);

The ListItem property for my server's home folder looks like this:

drwxrwxrwx 1 0 0 0 Apr 12 9:59 ./
drwxrwxrwx 1 0 0 0 Jun 1 2009 ../
drwxrwxrwx 1 0 0 0 Apr 14 10:03 Incoming/
drwxrwxrwx 1 0 0 0 Apr 13 16:36 Outgoing/


Complete thread: