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

asked 16 Jun '10, 11:38

Benjamin's gravatar image

Benjamin
16
accept rate: 0%


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.

link

answered 21 Jun '10, 11:45

Lukas%20Pokorny's gravatar image

Lukas Pokorny ♦♦
2.2k18
accept rate: 32%

edited 23 May '11, 17:37

Lukas%20Matyska's gravatar image

Lukas Matyska ♦♦
78217

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.

link

answered 16 Jun '10, 12:31

Lukas%20Pokorny's gravatar image

Lukas Pokorny ♦♦
2.2k18
accept rate: 32%

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.

(17 Jun '10, 08:33) Benjamin
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×136
×12

Asked: 16 Jun '10, 11:38

Seen: 735 times

Last updated: 23 May '11, 17:37