GetList() Wrong modified DateTime

0 votes
asked Jun 16, 2010 by Benjamin (150 points)
edited May 23, 2011

Hi, i have an FTP Server with a Linux Style Raw List. Normaly there is now Problem, but on this Server, if i make the GetList all Files have NOW as modified DateTime.

What is wrong there, does the Parser have Problem?

Example Line from RawList -rw-rw-rw- 1 user group 1929 Jun 1 18:02 xyz.zip

Applies to: Rebex FTP/SSL

2 Answers

0 votes
answered Jun 21, 2010 by Lukas Pokorny (104,290 points)
edited May 23, 2011
 
Best answer

It turned out this was caused by a bug in MLST listing parser. We will fix this in the next release due to be out in a week or two.

In the meantime, you can disable MLST listings by disabling the corresponding extension prior to calling the GetList mehod:

C#:

ftp.EnabledExtensions &= ~FtpExtensions.MachineProcessingList;

VB.NET

ftp.EnabledExtensions = ftp.EnabledExtensions And Not FtpExtensions.MachineProcessingList

(where "ftp" is an instance of Ftp object)

This will make the GetList method use LIST instead of MLST.

EDIT

This workaround is no longer needed. The fix in included in build 3854 released in summer 2010.

0 votes
answered Jun 16, 2010 by Lukas Pokorny (104,290 points)
edited Jun 16, 2010

The list parser returns DateTime.Now if there was a problem parsing the date, but that doesn't seem to be the case here. The following code parses the modified date fine using the same parser used by the GetList method:

FtpItem item = FtpItem.Parse("-rw-rw-rw- 1 user group 1929 Jun 1 18:02 xyz.zip");
Console.WriteLine(item.Modified);

There might be some additional non-printable characters in the raw listing that cause the problem you describe.

In order to determine what is going on, please try calling GetRawList instead of GetList method and send us the result - encode the lines as Base64 to preserve the original content:

System.Text.StringBuilder listing = new System.Text.StringBuilder();
string[] lines = ftp.GetRawList();
foreach (string line in lines)
{
    string encodedLine = Convert.ToBase64String(System.Text.Encoding.Default.GetBytes(line));
    listing.AppendLine(encodedLine);
}

string result = listing.ToString();

Mail us the content of result to support@rebex.net or edit your question to include the listing.

If you prefer VB.NET, please let me know.

commented Jun 17, 2010 by Benjamin (150 points)
If I parse it by my own than its working correctly. The parser ist working and I get the right modified time. And I also have send you an email with the Base64 encoding of this directory.
...